57 std::vector<std::string> variable;
64 std::vector<std::string> variable)
70 visit_node(configuration, node->NextSibling(), variable);
74 TiXmlElement* element = node->ToElement();
79 variable.push_back(element->Value());
83 const char* text = element->GetText();
92 visit_node(configuration, node->FirstChild(), variable);
109 child && !decl; child = child->NextSibling() ) {
110 decl = child->ToDeclaration ();
113 node =
xmlProfileDoc->InsertEndChild( TiXmlDeclaration(
"1.0",
"UTF-8",
"no" ) );
118 for (std::map<std::string, Variable*>::const_iterator conf_it = configuration->
begin();
119 conf_it != configuration->
end();
126 std::string variable_name = conf_it->second->get_name ();
130 for (
size_t i = 0; i < variable_name_vector.size(); i++) {
133 TiXmlElement* existing = node->FirstChildElement (variable_name_vector[i].c_str());
140 node = node->InsertEndChild (TiXmlElement (variable_name_vector[i].c_str()));
147 for(TiXmlNode* child = node->FirstChild(); child && !text; child = child->NextSibling() ) {
148 text = child->ToText ();
152 node->RemoveChild (text);
154 node = node->InsertEndChild (TiXmlText (conf_it->second->get_value ().c_str ()));
static std::vector< std::string > string_to_vector(const std::string &str)
void insert(const std::string &variable, const std::string &value)
std::map< std::string, Variable * >::const_iterator end() const
static std::string vector_to_string(const std::vector< std::string > &var)
bool file_read_ok() const
bool write_to_file() const
void read_from_configuration(Configuration *configuration)
TiXmlDocument * xmlProfileDoc
void visit_node(Configuration *config, TiXmlNode *node, std::vector< std::string > variable)
void read_into_configuration(Configuration *configuration)
void init_configuration(Configuration *config, TiXmlDocument *node)
std::map< std::string, Variable * >::const_iterator begin() const
Profile(const std::string &filename)