diff options
Diffstat (limited to 'xmlserializer')
-rw-r--r-- | xmlserializer/XmlElement.cpp | 7 | ||||
-rw-r--r-- | xmlserializer/XmlElement.h | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/xmlserializer/XmlElement.cpp b/xmlserializer/XmlElement.cpp index 106bfdc..d45f360 100644 --- a/xmlserializer/XmlElement.cpp +++ b/xmlserializer/XmlElement.cpp @@ -221,6 +221,13 @@ void CXmlElement::setAttributeInteger(const string& strAttributeName, uint32_t u setAttributeString(strAttributeName, strStream.str()); } +void CXmlElement::setAttributeSignedInteger(const string& strAttributeName, int32_t iValue) +{ + ostringstream strStream; + strStream << iValue; + setAttributeString(strAttributeName, strStream.str()); +} + void CXmlElement::setNameAttribute(const string& strValue) { setAttributeString("Name", strValue); diff --git a/xmlserializer/XmlElement.h b/xmlserializer/XmlElement.h index 9c5ca0e..7c1d518 100644 --- a/xmlserializer/XmlElement.h +++ b/xmlserializer/XmlElement.h @@ -71,6 +71,14 @@ public: void setTextContent(const std::string& strContent); void setComment(const std::string& strComment); void setAttributeInteger(const std::string& strAttributeName, uint32_t uiValue); + /** + * Set attribute with signed integer + * + * @param[in] strAttributeName The attribute name + * @param[in] iValue The attribute value + * + */ + void setAttributeSignedInteger(const std::string& strAttributeName, int32_t iValue); // Child creation void createChild(CXmlElement& childElement, const std::string& strType); |