48 using namespace Tools;
84 const size_t p0 = buffer.find_first_of(
'=');
86 const string svc = buffer.substr(0, p0);
87 const string desc = buffer.substr(p0+1);
89 const size_t p = desc.find_first_of(
'|');
92 const string d =
Trim(desc.substr(0, p));
94 vector<Description> vec;
95 vec.emplace_back(svc, d);
101 stringstream stream(desc.substr(p+1));
102 while (getline(stream, buf,
'|'))
107 const size_t p1 = buf.find_first_of(
':');
109 const string comment = p1==string::npos ?
"" : buf.substr(p1+1);
110 if (p1!=string::npos)
113 const size_t p2 = buf.find_last_of(
'[');
114 const size_t p3 = buf.find_last_of(
']');
116 const bool hasunit = p2<p3 && p2!=string::npos;
118 const string unit = hasunit ? buf.substr(p2+1, p3-p2-1) :
"";
119 const string name = hasunit ? buf.substr(0, p2) : buf;
121 vec.emplace_back(name, comment, unit);
143 str <<
"<H3>" << vec[0].name <<
"</H3>";
146 for (vector<Description>::const_iterator
i=vec.begin()+1;
i!=vec.end();
i++)
147 str <<
" <font color='maroon'><" <<
i->name <<
"></font>";
150 str <<
" <no arguments>";
152 str <<
"<P>" << vec[0].comment <<
"<P>";
156 for (vector<Description>::const_iterator
i=vec.begin()+1;
i!=vec.end();
i++)
159 "<td><font color='maroon'>" <<
i->name <<
"</font>";
161 if (
i->unit.empty() && !
i->comment.empty() && !
i->name.empty())
166 if (!
i->unit.empty())
167 str <<
"<td><font color='green'>[" <<
i->unit <<
"]</font>";
169 if (!
i->unit.empty() && !
i->comment.empty())
174 "<td><font color='navy'>" <<
i->comment <<
"</font></td>"
static std::string GetHtmlDescription(const std::vector< Description > &vec)
static std::vector< Description > SplitDescription(const std::string &buffer)
Description(const std::string &n, const std::string &c, const std::string &u="")