diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-06-21 08:04:56 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-06-21 08:04:56 +0000 |
commit | 9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 (patch) | |
tree | 4a505c1e0919af52800b3ffb3eaf135e7d6f9ce6 /indra/llxml/llxmlnode.h | |
parent | 351ebe9fcb76f3b99c2957004bb8493a904869ee (diff) |
merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3
ignore-dead-branch
Diffstat (limited to 'indra/llxml/llxmlnode.h')
-rw-r--r-- | indra/llxml/llxmlnode.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h index d4e127b05c..c983a14410 100644 --- a/indra/llxml/llxmlnode.h +++ b/indra/llxml/llxmlnode.h @@ -44,8 +44,8 @@ #include <map> #include "indra_constants.h" -#include "llmemory.h" -#include "llthread.h" +#include "llpointer.h" +#include "llthread.h" // LLThreadSafeRefCount #include "llstring.h" #include "llstringtable.h" @@ -153,8 +153,18 @@ public: LLXMLNodePtr& node, LLXMLNodePtr& update_node); static LLXMLNodePtr replaceNode(LLXMLNodePtr node, LLXMLNodePtr replacement_node); - static void writeHeaderToFile(LLFILE *fOut); - void writeToFile(LLFILE *fOut, const std::string& indent = std::string()); + + static bool getLayeredXMLNode(const std::string &xui_filename, 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()); void writeToOstream(std::ostream& output_stream, const std::string& indent = std::string()); // Utility @@ -207,6 +217,7 @@ public: U32 getLength() const { return mLength; } U32 getPrecision() const { return mPrecision; } const std::string& getValue() const { return mValue; } + std::string getSanitizedValue() const; std::string getTextContents() const; const LLStringTableEntry* getName() const { return mName; } BOOL hasName(const char* name) const { return mName == gStringTable.checkStringEntry(name); } @@ -227,6 +238,8 @@ public: bool getAttribute(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); bool getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); + S32 getLineNumber(); + // The following skip over attributes LLXMLNodePtr getFirstChild() const; LLXMLNodePtr getNextSibling() const; @@ -262,6 +275,8 @@ public: void setName(const std::string& name); void setName(LLStringTableEntry* name); + void setLineNumber(S32 line_number); + // Escapes " (quot) ' (apos) & (amp) < (lt) > (gt) static std::string escapeXML(const std::string& xml); @@ -300,6 +315,7 @@ public: U32 mPrecision; // The number of BITS per array item ValueType mType; // The value type Encoding mEncoding; // The value encoding + S32 mLineNumber; // line number in source file, if applicable LLXMLNode* mParent; // The parent node LLXMLChildrenPtr mChildren; // The child nodes @@ -312,7 +328,11 @@ public: protected: LLStringTableEntry *mName; // The name of this node - std::string mValue; // The value of this node (use getters/setters only) + + // The value of this node (use getters/setters only) + // Values are not XML-escaped in memory + // They may contain " (quot) ' (apos) & (amp) < (lt) > (gt) + std::string mValue; LLXMLNodePtr mDefault; // Mirror node in the default tree |