diff options
Diffstat (limited to 'src/XmlHandler/XmlWriter.cpp')
-rwxr-xr-x | src/XmlHandler/XmlWriter.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/XmlHandler/XmlWriter.cpp b/src/XmlHandler/XmlWriter.cpp index 59866a1..4fe216f 100755 --- a/src/XmlHandler/XmlWriter.cpp +++ b/src/XmlHandler/XmlWriter.cpp @@ -46,8 +46,13 @@ XmlWriter::XmlWriter(void) XmlWriter::~XmlWriter(void) { result r = E_SUCCESS; + int err = 0; - xmlTextWriterEndDocument(__pXmlWriter); + err = xmlTextWriterEndDocument(__pXmlWriter); + if (err != 0) + { + AppLogTag(OSP_INSTALLER, "xmlTextWriterEndDocument() is failed"); + } File file; r = file.Construct(__xmlFilePath, "w"); @@ -123,15 +128,21 @@ bool XmlWriter::StartElement(const Tizen::Base::String& name) { ByteBuffer* pNameBuf = null; + int err = 0; + bool res = true; pNameBuf = StringUtil::StringToUtf8N(name); if (pNameBuf) { - xmlTextWriterStartElement(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer()); + err = xmlTextWriterStartElement(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer()); + if (err != 0) + { + res = false; + } } delete pNameBuf; - return true; + return res; } bool @@ -139,33 +150,45 @@ XmlWriter::WriteAttribute(const Tizen::Base::String& name, const Tizen::Base::St { ByteBuffer* pNameBuf = null; ByteBuffer* pContentBuf = null; + int err = 0; + bool res = true; pNameBuf = StringUtil::StringToUtf8N(name); pContentBuf = StringUtil::StringToUtf8N(content); if (pNameBuf && pContentBuf) { - xmlTextWriterWriteAttribute(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer(), (xmlChar *)pContentBuf->GetPointer()); + err = xmlTextWriterWriteAttribute(__pXmlWriter, (xmlChar *)pNameBuf->GetPointer(), (xmlChar *)pContentBuf->GetPointer()); + if (err != 0) + { + res = false; + } } delete pNameBuf; delete pContentBuf; - return true; + return res; } bool XmlWriter::WriteString(const Tizen::Base::String& content) { ByteBuffer* pContentBuf = null; + int err = 0; + bool res = true; pContentBuf = StringUtil::StringToUtf8N(content); if (pContentBuf) { - xmlTextWriterWriteString(__pXmlWriter, (xmlChar *)pContentBuf->GetPointer()); + err = xmlTextWriterWriteString(__pXmlWriter, (xmlChar *)pContentBuf->GetPointer()); + if (err != 0) + { + res = false; + } } delete pContentBuf; - return true; + return res; } bool |