[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Base XML.cpp, 1.1, 1.2 XML.h, 1.1, 1.2
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-01-23 18:44:24
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Base In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1436 Modified Files: XML.cpp XML.h Log Message: append(); added. Index: XML.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Base/XML.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XML.h 22 Jan 2007 17:46:29 -0000 1.1 --- XML.h 23 Jan 2007 18:44:18 -0000 1.2 *************** *** 30,34 **** * \param _value Attribute's value (optional) */ XMLAttribute(std::string _name, ! std::string _value = ""); /** Get attribute's name --- 30,34 ---- * \param _value Attribute's value (optional) */ XMLAttribute(std::string _name, ! std::string _value = ""); /** Get attribute's name *************** *** 45,48 **** --- 45,52 ---- virtual void setValue(std::string _value); + /** Append a string to attribute's value + \param _value string to append */ + virtual void append(std::string _value); + /** Destructor */ virtual ~XMLAttribute(); *************** *** 52,55 **** --- 56,60 ---- * Internal representation of an XML node. * \sa XMLAttribute + * \sa XMLReader */ class XMLNode *************** *** 70,74 **** * \param _value Node's value (optional) */ XMLNode(std::string _name, ! std::string _value = ""); /** Get node's name --- 75,79 ---- * \param _value Node's value (optional) */ XMLNode(std::string _name, ! std::string _value = ""); /** Get node's name *************** *** 85,88 **** --- 90,97 ---- virtual void setValue(std::string _value); + /** Append a string to node's value + \param _value string to append */ + virtual void append(std::string _value); + /** Get childs' number * \return number of nodes held by current node Index: XML.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Base/XML.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XML.cpp 22 Jan 2007 17:46:28 -0000 1.1 --- XML.cpp 23 Jan 2007 18:44:18 -0000 1.2 *************** *** 32,35 **** --- 32,40 ---- } + void XMLAttribute::append(std::string _value) + { + value+=_value; + } + XMLAttribute::~XMLAttribute() { *************** *** 65,68 **** --- 70,78 ---- } + void XMLNode::append(std::string _value) + { + value+=_value; + } + int XMLNode::childNumber(void) { *************** *** 141,145 **** if ((!n_child) && (value=="")) { ! result+="/>\n"; return(result); } --- 151,157 ---- if ((!n_child) && (value=="")) { ! result+="/>"; ! if (_indent) ! result+="\n"; return(result); } *************** *** 159,163 **** indent(result, _indent); ! result+="</" + name + ">\n"; } else { if (value!="") { --- 171,177 ---- indent(result, _indent); ! result+="</" + name + ">"; ! if (_indent) ! result+="\n"; } else { if (value!="") { *************** *** 167,171 **** } indent(result, _indent); ! result+="</" + name + ">\n"; } --- 181,187 ---- } indent(result, _indent); ! result+="</" + name + ">"; ! if (_indent) ! result+="\n"; } |