The class:
class CatalogItem
{
private:
std::string m_gender;
std::string m_item_number;
float m_price;
std::vector<Size> m_sizes;
public:
void xml(xml::Bridge& xml);
};
The function for XML support:
void CatalogItem::xml(xml::Bridge& xml)
{
xml.node_name("catalog_item");
xml.attribute("gender", m_gender);
xml.child_stream("item_number", m_item_number);
xml.child_stream("price", m_price);
xml.children(m_sizes);
}
which does both, reading and writing of XML.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.