aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llsdserialize_xml.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llcommon/llsdserialize_xml.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/linden/indra/llcommon/llsdserialize_xml.cpp b/linden/indra/llcommon/llsdserialize_xml.cpp
index bb36fa7..04cdd57 100644
--- a/linden/indra/llcommon/llsdserialize_xml.cpp
+++ b/linden/indra/llcommon/llsdserialize_xml.cpp
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -253,7 +254,7 @@ public:
253 Impl(); 254 Impl();
254 ~Impl(); 255 ~Impl();
255 256
256 LLSD parse(std::istream& input); 257 S32 parse(std::istream& input, LLSD& data);
257 258
258 void parsePart(const char *buf, int len); 259 void parsePart(const char *buf, int len);
259 260
@@ -355,7 +356,7 @@ static unsigned get_till_eol(std::istream& input, char *buf, unsigned bufsize)
355 return count; 356 return count;
356} 357}
357 358
358LLSD LLSDXMLParser::Impl::parse(std::istream& input) 359S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
359{ 360{
360 reset(); 361 reset();
361 XML_Status status; 362 XML_Status status;
@@ -399,11 +400,13 @@ LLSD LLSDXMLParser::Impl::parse(std::istream& input)
399 { 400 {
400 ((char*) buffer)[count? count - 1 : 0] = '\0'; 401 ((char*) buffer)[count? count - 1 : 0] = '\0';
401 llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl; 402 llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl;
402 return LLSD(); 403 data = LLSD();
404 return -1;
403 } 405 }
404 406
405 clear_eol(input); 407 clear_eol(input);
406 return mResult; 408 data = mResult;
409 return 1;
407} 410}
408 411
409void LLSDXMLParser::Impl::reset() 412void LLSDXMLParser::Impl::reset()
@@ -722,6 +725,5 @@ void LLSDXMLParser::parsePart(const char *buf, int len)
722// virtual 725// virtual
723S32 LLSDXMLParser::parse(std::istream& input, LLSD& data) const 726S32 LLSDXMLParser::parse(std::istream& input, LLSD& data) const
724{ 727{
725 data = impl.parse(input); 728 return impl.parse(input, data);
726 return 0;
727} 729}