コード例 #1
0
            //-----------------------------------------------------------------
            //-----------------------------------------------------------------
            void ToXml(const ParamDictionary& in_dict, XML::Node* out_element)
            {
                XML::Document* doc = out_element->document();
                
                out_element->name(doc->allocate_string("Params"));
                
                for(auto it = in_dict.begin(); it != in_dict.end(); ++it)
                {
                    XML::Attribute* keyAttribute = out_element->document()->allocate_attribute();
                    keyAttribute->name(out_element->document()->allocate_string("key"));
                    keyAttribute->value(out_element->document()->allocate_string(it->first.c_str()));
                    
                    XML::Attribute* valueAttribute = out_element->document()->allocate_attribute();
                    valueAttribute->name(out_element->document()->allocate_string("value"));
                    valueAttribute->value(out_element->document()->allocate_string(it->second.c_str()));

                    XML::Node* node = out_element->document()->allocate_node(rapidxml::node_type::node_element);
                    node->name(doc->allocate_string("Param"));
                    node->append_attribute(keyAttribute);
                    node->append_attribute(valueAttribute);
                    out_element->append_node(node);
                }
            }
コード例 #2
0
ファイル: Elements.hpp プロジェクト: binary42/OCI
 FundamentalType (XML::Attribute<C> const& a)
 {
   std::basic_stringstream<C> s;
   s << a.value ();
   s >> x_;
 }