diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-05-13 18:26:53 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-05-13 21:25:58 +0300 |
commit | 2008f87f10d51a2f9372aa4a4d72e86ac94e1e81 (patch) | |
tree | 2f9f228e3e08380ddad59539669f31667d3dd4a7 /indra/llxml/llxmlnode.h | |
parent | ad6425173900855852b8c8437cc88120ea46cc53 (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/llxmlnode.h')
-rw-r--r-- | indra/llxml/llxmlnode.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h index e09c89c543..d5b8b36d86 100644 --- a/indra/llxml/llxmlnode.h +++ b/indra/llxml/llxmlnode.h @@ -121,39 +121,39 @@ public: LLXMLNode(const char* name, bool is_attribute); LLXMLNode(LLStringTableEntry* name, bool is_attribute); LLXMLNode(const LLXMLNode& rhs); - LLXMLNodePtr deepCopy() const; + LLXMLNodePtr deepCopy(); bool isNull(); bool deleteChild(LLXMLNode* child); - void addChild(LLXMLNodePtr& new_child); + void addChild(LLXMLNodePtr& new_child); void setParent(LLXMLNodePtr& new_parent); // reparent if necessary - // Deserialization + // Serialization static bool parseFile( const std::string& filename, - LLXMLNodePtr& node, - LLXMLNode* defaults_tree, - bool cacheable = false); - static bool parseBuffer( - const char* buffer, - U32 length, - LLXMLNodePtr& node, - LLXMLNode* defaults); + LLXMLNodePtr& node, + LLXMLNode* defaults_tree); + static bool parseBuffer( + U8* buffer, + U32 length, + LLXMLNodePtr& node, + LLXMLNode* defaults); static bool parseStream( std::istream& str, - LLXMLNodePtr& node, + LLXMLNodePtr& node, LLXMLNode* defaults); static bool updateNode( LLXMLNodePtr& node, LLXMLNodePtr& update_node); - - static bool getLayeredXMLNode(LLXMLNodePtr& root, const std::vector<std::string>& paths, bool cacheable = false); - + + static bool getLayeredXMLNode(LLXMLNodePtr& root, const std::vector<std::string>& paths); + + // Write standard XML file header: // <?xml version="1.0" encoding="utf-8" standalone="yes" ?> static void writeHeaderToFile(LLFILE *out_file); - + // Write XML to file with one attribute per line. // XML escapes values as they are written. void writeToFile(LLFILE *out_file, const std::string& indent = std::string(), bool use_type_decorations=true); @@ -237,7 +237,7 @@ public: // Setters bool setAttributeString(const char* attr, const std::string& value); - + void setBoolValue(const bool value) { setBoolValue(1, &value); } void setByteValue(const U8 value, Encoding encoding = ENCODING_DEFAULT) { setByteValue(1, &value, encoding); } void setIntValue(const S32 value, Encoding encoding = ENCODING_DEFAULT) { setIntValue(1, &value, encoding); } @@ -290,10 +290,6 @@ public: protected: bool removeChild(LLXMLNode* child); - static bool parseBuffer( - const char* buffer, - U32 length, - LLXMLNodePtr& node); public: std::string mID; // The ID attribute of this node |