FACT++  1.0
string Description::GetHtmlDescription ( const std::vector< Description > &  vec)
static

Returns a string with an html formatted text containing the descriptions as returned by SplitDescription

Parameters
vecvector of Description for the individual arguments. First element is the global description of the command or service.
Returns
string with html formatted text

Definition at line 140 of file Description.cc.

References i, if(), and str.

Referenced by FactGui::AddDescription().

141 {
142  stringstream str;
143  str << "<H3>" << vec[0].name << "</H3>";
144 
145  str << "Usage:";
146  for (vector<Description>::const_iterator i=vec.begin()+1; i!=vec.end(); i++)
147  str << "&nbsp;<font color='maroon'>&lt;" << i->name << "&gt;</font>";
148 
149  if (vec.size()==1)
150  str << " &lt;no arguments&gt;";
151 
152  str << "<P>" << vec[0].comment << "<P>";
153 
154  str << "<table>";
155 
156  for (vector<Description>::const_iterator i=vec.begin()+1; i!=vec.end(); i++)
157  {
158  str << "<tr>"
159  "<td><font color='maroon'>" << i->name << "</font>";
160 
161  if (i->unit.empty() && !i->comment.empty() && !i->name.empty())
162  str << ':';
163 
164  str << "</td>";
165 
166  if (!i->unit.empty())
167  str << "<td><font color='green'>[" << i->unit << "]</font>";
168 
169  if (!i->unit.empty() && !i->comment.empty())
170  str << ':';
171 
172  str <<
173  "</td>"
174  "<td><font color='navy'>" << i->comment << "</font></td>"
175  "</tr>";
176  }
177 
178  str << "</table>";
179 
180  return str.str();
181 }
int i
Definition: db_dim_client.c:21
char str[80]
Definition: test_client.c:7
if(extraDns) new Dns

+ Here is the call graph for this function:

+ Here is the caller graph for this function: