diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llcommon/llsdserialize_xml.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/llcommon/llsdserialize_xml.cpp')
-rw-r--r-- | linden/indra/llcommon/llsdserialize_xml.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/linden/indra/llcommon/llsdserialize_xml.cpp b/linden/indra/llcommon/llsdserialize_xml.cpp index b8adcf1..7de0c35 100644 --- a/linden/indra/llcommon/llsdserialize_xml.cpp +++ b/linden/indra/llcommon/llsdserialize_xml.cpp | |||
@@ -305,6 +305,7 @@ private: | |||
305 | XML_Parser mParser; | 305 | XML_Parser mParser; |
306 | 306 | ||
307 | LLSD mResult; | 307 | LLSD mResult; |
308 | S32 mParseCount; | ||
308 | 309 | ||
309 | bool mInLLSDElement; | 310 | bool mInLLSDElement; |
310 | bool mGracefullStop; | 311 | bool mGracefullStop; |
@@ -411,12 +412,12 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data) | |||
411 | } | 412 | } |
412 | llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl; | 413 | llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl; |
413 | data = LLSD(); | 414 | data = LLSD(); |
414 | return -1; | 415 | return LLSDParser::PARSE_FAILURE; |
415 | } | 416 | } |
416 | 417 | ||
417 | clear_eol(input); | 418 | clear_eol(input); |
418 | data = mResult; | 419 | data = mResult; |
419 | return 1; | 420 | return mParseCount; |
420 | } | 421 | } |
421 | 422 | ||
422 | void LLSDXMLParser::Impl::reset() | 423 | void LLSDXMLParser::Impl::reset() |
@@ -428,6 +429,7 @@ void LLSDXMLParser::Impl::reset() | |||
428 | } | 429 | } |
429 | 430 | ||
430 | mResult.clear(); | 431 | mResult.clear(); |
432 | mParseCount = 0; | ||
431 | 433 | ||
432 | mInLLSDElement = false; | 434 | mInLLSDElement = false; |
433 | mDepth = 0; | 435 | mDepth = 0; |
@@ -472,7 +474,7 @@ LLSDXMLParser::Impl::findAttribute(const XML_Char* name, const XML_Char** pairs) | |||
472 | return NULL; | 474 | return NULL; |
473 | } | 475 | } |
474 | 476 | ||
475 | void LLSDXMLParser::Impl::parsePart(const char *buf, int len) | 477 | void LLSDXMLParser::Impl::parsePart(const char* buf, int len) |
476 | { | 478 | { |
477 | void * buffer = XML_GetBuffer(mParser, len); | 479 | void * buffer = XML_GetBuffer(mParser, len); |
478 | if (buffer != NULL && buf != NULL) | 480 | if (buffer != NULL && buf != NULL) |
@@ -486,7 +488,7 @@ void LLSDXMLParser::Impl::parsePart(const char *buf, int len) | |||
486 | 488 | ||
487 | void LLSDXMLParser::Impl::startElementHandler(const XML_Char* name, const XML_Char** attributes) | 489 | void LLSDXMLParser::Impl::startElementHandler(const XML_Char* name, const XML_Char** attributes) |
488 | { | 490 | { |
489 | mDepth += 1; | 491 | ++mDepth; |
490 | if (mSkipping) | 492 | if (mSkipping) |
491 | { | 493 | { |
492 | return; | 494 | return; |
@@ -554,6 +556,7 @@ void LLSDXMLParser::Impl::startElementHandler(const XML_Char* name, const XML_Ch | |||
554 | return startSkipping(); | 556 | return startSkipping(); |
555 | } | 557 | } |
556 | 558 | ||
559 | ++mParseCount; | ||
557 | switch (element) | 560 | switch (element) |
558 | { | 561 | { |
559 | case ELEMENT_MAP: | 562 | case ELEMENT_MAP: |
@@ -572,7 +575,7 @@ void LLSDXMLParser::Impl::startElementHandler(const XML_Char* name, const XML_Ch | |||
572 | 575 | ||
573 | void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name) | 576 | void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name) |
574 | { | 577 | { |
575 | mDepth -= 1; | 578 | --mDepth; |
576 | if (mSkipping) | 579 | if (mSkipping) |
577 | { | 580 | { |
578 | if (mDepth < mSkipThrough) | 581 | if (mDepth < mSkipThrough) |
@@ -715,10 +718,10 @@ LLSDXMLParser::Impl::Element LLSDXMLParser::Impl::readElement(const XML_Char* na | |||
715 | 718 | ||
716 | 719 | ||
717 | 720 | ||
718 | 721 | /** | |
719 | 722 | * LLSDXMLParser | |
720 | LLSDXMLParser::LLSDXMLParser() | 723 | */ |
721 | : impl(* new Impl) | 724 | LLSDXMLParser::LLSDXMLParser() : impl(* new Impl) |
722 | { | 725 | { |
723 | } | 726 | } |
724 | 727 | ||
@@ -733,7 +736,7 @@ void LLSDXMLParser::parsePart(const char *buf, int len) | |||
733 | } | 736 | } |
734 | 737 | ||
735 | // virtual | 738 | // virtual |
736 | S32 LLSDXMLParser::parse(std::istream& input, LLSD& data) const | 739 | S32 LLSDXMLParser::doParse(std::istream& input, LLSD& data) const |
737 | { | 740 | { |
738 | return impl.parse(input, data); | 741 | return impl.parse(input, data); |
739 | } | 742 | } |