Time of state change.
This function breaks down a descriptive string into its components. For details see class reference.
- Parameters
-
buffer | string which should be broekn into pieces |
- Returns
- A vector<State> containing all the states found.
Definition at line 58 of file State.cc.
References comment, Compare(), index, and name.
Referenced by DimDescribedState::HandleDesc(), and DimServiceInfoList::infoHandler().
63 stringstream stream(
buffer);
64 while (getline(stream, buf,
'\n'))
69 const size_t p1 = buf.find_first_of(
':');
70 const size_t p2 = buf.find_first_of(
'=');
72 stringstream s(buf.substr(0, p1));
77 const string name = buf.substr(p1+1, p2-p1-1);
78 const string comment = p2==string::npos ?
"" : buf.substr(p2+1);
80 vec.emplace_back(index, name, comment);
std::string comment
Name (e.g. 'Connected')
static bool Compare(const State &i, const State &j)
std::string name
Index (e.g. 1)