diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-19 00:45:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-19 19:24:16 +0300 |
commit | af9bb538a0609893db7d5f2582595660395f0821 (patch) | |
tree | 12bfaa637afd44b87584e16c589632d06dcea079 /src | |
parent | 6e9ba17bef418a058e84ff5e248ea479d4836669 (diff) |
BytesParsed - a function to control parsed xml length
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/tinyxml2.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/tinyxml2.h | 6 |
4 files changed, 9 insertions, 1 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 0ce94238f5..1fafa5915d 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1418,3 +1418,4 @@ db_event_edit @1268 db_get_utfa @1631
?GetTextU@CCtrlBase@@QAEPADPADI@Z @1632 NONAME
?GetTextU@CCtrlBase@@QAEPADXZ @1633 NONAME
+?BytesParsed@XMLDocument@tinyxml2@@QBEHXZ @1634 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index f508deb72d..f395c92786 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1418,3 +1418,4 @@ db_event_edit @1268 db_get_utfa @1631
?GetTextU@CCtrlBase@@QEAAPEADPEAD_K@Z @1632 NONAME
?GetTextU@CCtrlBase@@QEAAPEADXZ @1633 NONAME
+?BytesParsed@XMLDocument@tinyxml2@@QEBAHXZ @1634 NONAME
diff --git a/src/mir_core/src/tinyxml2.cpp b/src/mir_core/src/tinyxml2.cpp index a7f94a0153..a81c7d77f7 100644 --- a/src/mir_core/src/tinyxml2.cpp +++ b/src/mir_core/src/tinyxml2.cpp @@ -1096,6 +1096,7 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ) } InsertEndChild( node ); } + _document->_bytesParsed = (int)(p-_document->_charBuffer); return 0; } @@ -2395,6 +2396,7 @@ void XMLDocument::Parse() TIXMLASSERT( _charBuffer ); _parseCurLineNum = 1; _parseLineNum = 1; + _bytesParsed = 0; char* p = _charBuffer; p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum ); p = const_cast<char*>( XMLUtil::ReadBOM( p, &_writeBOM ) ); diff --git a/src/mir_core/src/tinyxml2.h b/src/mir_core/src/tinyxml2.h index 168f825d1a..40b3067e1c 100644 --- a/src/mir_core/src/tinyxml2.h +++ b/src/mir_core/src/tinyxml2.h @@ -1735,6 +1735,9 @@ public: Whitespace WhitespaceMode() const { return _whitespaceMode; } + int BytesParsed() const { + return _bytesParsed; + } /** Returns true if this document has a leading Byte Order Mark of UTF8. @@ -1884,7 +1887,8 @@ private: int _errorLineNum; char* _charBuffer; int _parseCurLineNum; - int _parsingDepth; + int _parsingDepth; + int _bytesParsed; // Memory tracking does add some overhead. // However, the code assumes that you don't // have a bunch of unlinked nodes around. |