diff options
Diffstat (limited to 'indra/llcommon/llsdserialize_xml.cpp')
-rw-r--r-- | indra/llcommon/llsdserialize_xml.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index 34b3dbb99a..cef743a7be 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -250,7 +250,7 @@ std::string LLSDXMLFormatter::escapeString(const std::string& in) class LLSDXMLParser::Impl { public: - Impl(); + Impl(bool emit_errors); ~Impl(); S32 parse(std::istream& input, LLSD& data); @@ -294,6 +294,7 @@ private: static const XML_Char* findAttribute(const XML_Char* name, const XML_Char** pairs); + bool mEmitErrors; XML_Parser mParser; @@ -315,7 +316,8 @@ private: }; -LLSDXMLParser::Impl::Impl() +LLSDXMLParser::Impl::Impl(bool emit_errors) + : mEmitErrors(emit_errors) { mParser = XML_ParserCreate(NULL); reset(); @@ -402,7 +404,10 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data) { ((char*) buffer)[count ? count - 1 : 0] = '\0'; } - llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl; + if (mEmitErrors) + { + llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl; + } data = LLSD(); return LLSDParser::PARSE_FAILURE; } @@ -480,7 +485,10 @@ S32 LLSDXMLParser::Impl::parseLines(std::istream& input, LLSD& data) if (status == XML_STATUS_ERROR && !mGracefullStop) { - llinfos << "LLSDXMLParser::Impl::parseLines: XML_STATUS_ERROR" << llendl; + if (mEmitErrors) + { + llinfos << "LLSDXMLParser::Impl::parseLines: XML_STATUS_ERROR" << llendl; + } return LLSDParser::PARSE_FAILURE; } @@ -897,7 +905,7 @@ LLSDXMLParser::Impl::Element LLSDXMLParser::Impl::readElement(const XML_Char* na /** * LLSDXMLParser */ -LLSDXMLParser::LLSDXMLParser() : impl(* new Impl) +LLSDXMLParser::LLSDXMLParser(bool emit_errors /* = true */) : impl(* new Impl(emit_errors)) { } |