summaryrefslogtreecommitdiff
path: root/indra/llxml/llxmltree.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-05-13 18:26:53 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-05-13 21:25:58 +0300
commit2008f87f10d51a2f9372aa4a4d72e86ac94e1e81 (patch)
tree2f9f228e3e08380ddad59539669f31667d3dd4a7 /indra/llxml/llxmltree.cpp
parentad6425173900855852b8c8437cc88120ea46cc53 (diff)
Revert "viewer#819 Avoid reading the same XML file multiple times"
This reverts commit a865d423974ea06dffa47798c81e98e7570b02ec. Reason for revert: viewer#1420, reverting to not hold maint-A (is deepCopy not full?)
Diffstat (limited to 'indra/llxml/llxmltree.cpp')
-rw-r--r--indra/llxml/llxmltree.cpp45
1 files changed, 3 insertions, 42 deletions
diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp
index 0c1615f486..a9c702f552 100644
--- a/indra/llxml/llxmltree.cpp
+++ b/indra/llxml/llxmltree.cpp
@@ -35,7 +35,6 @@
#include "v4math.h"
#include "llquaternion.h"
#include "lluuid.h"
-#include "lldir.h"
//////////////////////////////////////////////////////////////
// LLXmlTree
@@ -61,37 +60,20 @@ void LLXmlTree::cleanup()
mNodeNames.cleanup();
}
-bool LLXmlTree::parseFile(const std::string & filename, bool keep_contents)
-{
- delete mRoot;
- mRoot = NULL;
-
- std::string xml = gDirUtilp->getFileContents(filename);
- if (xml.empty())
- {
- LL_WARNS() << "LLXmlTree parse failed. No XML file: " << filename << LL_ENDL;
- return false;
- }
-
- bool success = parseString(xml, keep_contents);
- return success;
-}
-
-bool LLXmlTree::parseString(const std::string &xml, bool keep_contents)
+bool LLXmlTree::parseFile(const std::string &path, bool keep_contents)
{
delete mRoot;
mRoot = NULL;
LLXmlTreeParser parser(this);
- bool success = parser.parseString(xml, &mRoot, keep_contents);
- if (!success)
+ bool success = parser.parseFile( path, &mRoot, keep_contents );
+ if( !success )
{
S32 line_number = parser.getCurrentLineNumber();
const char* error = parser.getErrorString();
LL_WARNS() << "LLXmlTree parse failed. Line " << line_number << ": " << error << LL_ENDL;
}
-
return success;
}
@@ -554,27 +536,6 @@ bool LLXmlTreeParser::parseFile(const std::string &path, LLXmlTreeNode** root, b
return success;
}
-bool LLXmlTreeParser::parseString(const std::string& xml, LLXmlTreeNode** root, bool keep_contents)
-{
- llassert( !mRoot );
- llassert( !mCurrent );
-
- mKeepContents = keep_contents;
-
- bool success = LLXmlParser::parse(xml.data(), (int)xml.size(), true);
-
- *root = mRoot;
- mRoot = NULL;
-
- if (success)
- {
- llassert(!mCurrent);
- }
-
- mCurrent = NULL;
-
- return success;
-}
const std::string& LLXmlTreeParser::tabs()
{