From a58fc91f01c45f9fdd85b47ded53ecb045b6c6b0 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Thu, 6 Mar 2014 04:02:01 +0000 Subject: [PATCH] Added back a routine that caused numerous downstream failures. --- include/cantera/base/xml.h | 11 +++++++++++ src/base/xml.cpp | 12 ++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/include/cantera/base/xml.h b/include/cantera/base/xml.h index 22406c8ca..a7deca896 100644 --- a/include/cantera/base/xml.h +++ b/include/cantera/base/xml.h @@ -280,7 +280,18 @@ public: void addAttribute(const std::string& attrib, const doublereal value, const std::string& fmt="%g"); + //! Add an integer attribute + /*! + * @param attrib String name for the attribute to be assigned + * @param value int Value that the node will be assigned + */ + void addAttribute(const std::string& attrib, int value); + //! Add an unsigned integer attribute + /*! + * @param attrib String name for the attribute to be assigned + * @param value int Value that the node will be assigned + */ void addAttribute(const std::string& attrib, size_t value); //! The operator[] is overloaded to provide a lookup capability diff --git a/src/base/xml.cpp b/src/base/xml.cpp index 7487c61d5..32463431e 100644 --- a/src/base/xml.cpp +++ b/src/base/xml.cpp @@ -416,18 +416,18 @@ XML_Node& XML_Node::addChild(const std::string& sname) return mergeAsChild(*(new XML_Node(sname, this))); } -XML_Node& XML_Node::addChild(const std::string& name_, const std::string& value_) +XML_Node& XML_Node::addChild(const std::string& name, const std::string& value) { - XML_Node& c = addChild(name_); - c.addValue(value_); + XML_Node& c = addChild(name); + c.addValue(value); return c; } -XML_Node& XML_Node::addChild(const std::string& name_, const doublereal value_, +XML_Node& XML_Node::addChild(const std::string& name, const doublereal value, const std::string& fmt) { - XML_Node& c = addChild(name_); - c.addValue(value_, fmt); + XML_Node& c = addChild(name); + c.addValue(value, fmt); return c; }