CMS 3D CMS Logo

HGCalGeomUtils.cc
Go to the documentation of this file.
2 
3 std::vector<std::string> HGCalGeomUtils::splitString(const std::string& fLine) {
4  std::vector<std::string> result;
5  int start = 0;
6  bool empty = true;
7  for (unsigned i = 0; i <= fLine.size(); i++) {
8  if (fLine[i] == ' ' || i == fLine.size()) {
9  if (!empty) {
10  std::string item(fLine, start, i - start);
11  result.emplace_back(item);
12  empty = true;
13  }
14  start = i + 1;
15  } else {
16  if (empty)
17  empty = false;
18  }
19  }
20  return result;
21 }
Definition: start.py:1
std::vector< std::string > splitString(const std::string &)