Public Member Functions | |
IgConfigElementNode () | |
Static Public Member Functions | |
static IgConfigElementNode * | find (IgConfigElementNode *node, const std::string &name) |
static void | print (IgConfigElementNode *node, std::ostream &out, const std::string &itab="") |
Public Attributes | |
std::vector< IgConfigElementNode > | childs |
bool | hasValue |
std::string | name |
std::string | value |
Definition at line 28 of file IgConfigElement.cc.
IgConfigElementNode::IgConfigElementNode | ( | ) | [inline] |
IgConfigElementNode * IgConfigElementNode::find | ( | IgConfigElementNode * | node, | |
const std::string & | name | |||
) | [static] |
Definition at line 380 of file IgConfigElement.cc.
References childs, i, and name.
Referenced by IgConfigElement::save().
00382 { 00383 if (node->name == "") 00384 node->name = name; 00385 else if (node->name == name) 00386 return node; 00387 else 00388 { 00389 for (size_t i = 0; i < node->childs.size (); i++) 00390 { 00391 if (node->childs [i].name == name) 00392 return &node->childs [i]; 00393 } 00394 IgConfigElementNode child; 00395 child.name = name; 00396 node->childs.push_back (child); 00397 node = &node->childs [node->childs.size () - 1]; 00398 } 00399 return node; 00400 }
void IgConfigElementNode::print | ( | IgConfigElementNode * | node, | |
std::ostream & | out, | |||
const std::string & | itab = "" | |||
) | [static] |
Definition at line 402 of file IgConfigElement.cc.
References childs, lat::endl(), hasValue, i, name, and value.
Referenced by IgConfigElement::save().
00405 { 00406 if (node->name.empty()) return; 00407 out << itab.c_str () << "<" << node->name.c_str () << ">"; 00408 if (node->hasValue) 00409 out << node->value.c_str () << "</" << node->name.c_str () << ">" << std::endl; 00410 else 00411 { 00412 out << std::endl; 00413 for (size_t i = 0; i < node->childs.size (); i++) 00414 print (&node->childs [i], out, itab + " "); 00415 out << itab.c_str () << "</" << node->name.c_str () << ">" << std::endl; 00416 } 00417 }
std::vector<IgConfigElementNode> IgConfigElementNode::childs |
Definition at line 37 of file IgConfigElement.cc.
Referenced by find(), print(), and IgConfigElement::save().
Definition at line 36 of file IgConfigElement.cc.
Referenced by IgConfigElementNode(), print(), and IgConfigElement::save().
std::string IgConfigElementNode::name |
Definition at line 34 of file IgConfigElement.cc.
Referenced by find(), print(), and IgConfigElement::save().
std::string IgConfigElementNode::value |
Definition at line 35 of file IgConfigElement.cc.
Referenced by print(), and IgConfigElement::save().