aboutsummaryrefslogtreecommitdiffstats
path: root/xmlserializer
diff options
context:
space:
mode:
Diffstat (limited to 'xmlserializer')
-rw-r--r--xmlserializer/XmlElement.cpp7
-rw-r--r--xmlserializer/XmlElement.h8
-rw-r--r--xmlserializer/XmlStringDocSink.cpp3
3 files changed, 17 insertions, 1 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);
diff --git a/xmlserializer/XmlStringDocSink.cpp b/xmlserializer/XmlStringDocSink.cpp
index 4b05d85..caec545 100644
--- a/xmlserializer/XmlStringDocSink.cpp
+++ b/xmlserializer/XmlStringDocSink.cpp
@@ -27,7 +27,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#include "XmlStringDocSink.h"
#include <libxml/parser.h>
@@ -50,6 +49,8 @@ bool CXmlStringDocSink::doProcess(CXmlDocSource& xmlDocSource,
if (!pcDumpedDoc) {
+ serializingContext.setError("Unable to encode XML document in memory");
+
return false;
}