14 #include <osgEarth/Config>
75 std::string type()
const;
83 void setType(
const std::string& type);
87 void setIndex(
int index);
111 void parseTextAndElements();
116 void update(
const XmlElementKey& key,
const osgEarth::Config& config);
119 void updateName(
const XmlElementKey& key,
const std::string& newName);
122 void modify(
const XmlElementKey& key,
const osgEarth::Config& config);
127 void add(
const XmlElementKey& key,
const osgEarth::Config& config);
136 void addTextNode(
const XmlElementKey& key,
const std::string& text);
141 osgEarth::Util::XmlElement* findChildElement(osgEarth::Util::XmlElement* element,
const XmlElementKey& key);
146 osgEarth::Util::XmlElement* findParentElement(osgEarth::Util::XmlElement* element,
const XmlElementKey& key);
152 void updateConfig(
size_t startPos, osgEarth::Util::XmlElement* element,
const osgEarth::Config& config);
154 void modifyConfig(
size_t startPos, osgEarth::Util::XmlElement* element,
const osgEarth::Config& config);
160 void updateXmlText(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& text);
165 osgEarth::Util::XmlText* findXmlTextNode(osgEarth::Util::XmlElement* element);
169 void modifyTextNode(osgEarth::XmlElement* element,
const std::string& text);
172 std::set<std::string> getUniqueChildKeysOfConfig(
const osgEarth::Config& config)
const;
175 std::set<std::string> getUniqueChildKeysOfElement(
const osgEarth::Util::XmlElement* element)
const;
179 std::string findNameOfConfig(
const osgEarth::Config& config);
182 virtual bool checkExternalReference(
const std::string& text);
186 virtual bool findUrl(
const std::string& text, std::string& url);
189 virtual void parseExternalReference(
const std::string& text);
202 std::vector< std::pair<std::string, std::string> > getXmlElementNodes()
const;
207 virtual XmlElementKey getXmlElementKey(
const osgEarth::XmlElement* parent,
const osgEarth::XmlElement* element)
const;
210 virtual osgEarth::XmlElement* root();
225 virtual bool findXmlElementKey(osgEarth::Util::XmlElement* element,
const std::string& type,
const std::string& name,
229 virtual void setFileName(
const DtUnicode& fileName);
235 virtual void save(
const DtUnicode& fileName);
238 virtual std::string getXmlElementType(
const osgEarth::Util::XmlElement* element)
const;
245 virtual int getXmlElementIndex(
const osgEarth::Util::XmlElement* parent,
const osgEarth::Util::XmlElement* element)
const;
248 virtual std::string getXmlElementName(
const osgEarth::Util::XmlElement* element)
const;
251 DtOsgEarthFile* findOsgEarthFile(
const std::string& type,
const std::string& name);
256 virtual void processXmlNode(
const osgEarth::Util::XmlNode* node);
259 virtual void processXmlElement(
const osgEarth::Util::XmlElement* element);
262 virtual void processXmlText(
const osgEarth::Util::XmlText* text);
269 void addOrModifyConfig(
size_t startPos, osgEarth::XmlElement* element,
const osgEarth::Config& config,
int index);
277 void addOrModifySimpleConfig(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& value,
int index);
284 void addOrModifyNonSimpleConfig(
size_t startPos, osgEarth::Util::XmlElement* element,
const osgEarth::Config& config,
int index);
291 virtual bool modifyXmlAttribute(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue);
297 virtual bool removeXmlAttribute(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key);
304 virtual bool removeXmlElement(
size_t startPos, osgEarth::Util::XmlElement* parent,
const std::string& key,
int index);
312 virtual bool moveXmlElement(
size_t startPos, osgEarth::Util::XmlElement* parent,
const std::string& key,
int index,
int newIndex);
320 virtual bool modifyXmlSimpleElement(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue,
int index);
327 virtual bool addXmlAttribute(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue);
334 virtual bool addXmlSimpleElement(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue,
int index);
341 virtual bool addXmlNonSimpleElement(
size_t startPos, osgEarth::Util::XmlElement* element,
const osgEarth::Config& config,
int index);
347 virtual bool addXmlTextNode(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& text);
351 virtual std::string getConfigString(
const osgEarth::Config& config);
356 virtual std::string getXmlAttributeString(
const std::string& key,
const std::string& value);
361 virtual std::string getSimpleConfigString(
const std::string& key,
const std::string& value);
367 virtual void updateAttribute(osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue);
373 virtual void removeAttribute(osgEarth::Util::XmlElement* element,
const std::string& key);
379 virtual void removeElement(osgEarth::Util::XmlElement* element,
const std::string& key,
int index);
386 virtual void updateSimpleElement(osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue,
int index);
392 virtual void addAttribute(osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& value);
398 virtual void addSimpleElement(osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue);
404 virtual void addNonSimpleElement(osgEarth::Util::XmlElement* element, osgEarth::Util::XmlElement* child);
409 virtual void addTextNode(osgEarth::Util::XmlElement* element,
const std::string& text);
414 virtual bool hasAttribute(
const osgEarth::Util::XmlElement* element,
const std::string& key);
421 virtual osgEarth::XmlElement* findSubElement(
const osgEarth::Util::XmlElement* element,
const std::string& key,
int index);
426 virtual int findSubElementMaximumIndex(
const osgEarth::XmlElement* element,
const std::string& key);
432 virtual bool hasChild(
const osgEarth::Config& config,
const std::string& key,
int index);
438 virtual size_t findStartPos(
size_t startPos,
const osgEarth::Util::XmlElement* element,
const XmlElementKey& key);
441 virtual std::string getElementStartPattern(
const std::string& key)
const;
444 virtual std::string getElementEndPattern(
const osgEarth::Util::XmlElement* element)
const;
447 virtual std::string getElementEndPattern(
const std::string& key)
const;
450 virtual std::string getAttributeStartPattern(
const std::string& key)
const;
457 virtual bool getAttributeValue(
size_t startPos,
size_t endPos,
const std::string& key, std::string& value)
const;
464 virtual bool getElementValue(
size_t startPos,
size_t endPos,
const std::string& key, std::string& value)
const;
468 std::string formatValue(
const std::string& value)
const;
472 virtual bool isReservedKeyWord(
const std::string& key)
const;
481 virtual bool ifElementHasChild(osgEarth::Util::XmlElement* root,
const std::string& type,
const std::string& name,
int currentDepth = 0,
int maxDepth = 2);
513 virtual void parse(
const DtUnicode& fileName);
519 virtual void addConfig(
const std::string& parentType,
const std::string& parentName,
const osgEarth::Config& config);
524 virtual void removeConfig(
const std::string& type,
const std::string& name);
530 virtual void moveConfig(
const std::string& type,
const std::string& name,
int newIndex);
535 virtual void updateConfig(
const std::string& name,
const std::string& type,
const osgEarth::Config& config);
541 virtual void updateName(
const std::string& oldName,
const std::string& type,
const std::string& newName);
546 virtual void modifyConfig(
const std::string& name,
const osgEarth::Config& config);
557 virtual bool hasExternalFiles()
const;
561 virtual void save(
const DtUnicode& fileName);
565 virtual void setRootFileName(
const DtUnicode& fileName);
XmlElementKey.
Definition: DtOsgEarthFileParser.h:43
DtOsgEarthFileParser.
Definition: DtOsgEarthFileParser.h:501
osgEarth::Util::XmlElement * myRoot
Definition: DtOsgEarthFileParser.h:492
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
std::vector< osgEarth::Util::XmlText * > XmlTextList
Definition: DtOsgEarthFileParser.h:35
std::vector< DtOsgEarthFile * > ExternalFileList
Definition: DtOsgEarthFileParser.h:36
int myIndex
Definition: DtOsgEarthFileParser.h:97
#define DT_DLL_VRVOSGEARTH
Definition: vrvOsgEarth.h:21
DtOsgEarthFile * myRootFile
Definition: DtOsgEarthFileParser.h:568
DtUnicode myFileName
Definition: DtOsgEarthFileParser.h:496
std::string myModifiedText
Definition: DtOsgEarthFileParser.h:494
ExternalFileList myExternalFileList
Definition: DtOsgEarthFileParser.h:493
std::string myOriginalText
Definition: DtOsgEarthFileParser.h:495
bool operator==(const DtTextureAtlasIndexParser::StringOrFloatAttrib &lhs, const DtTextureAtlasIndexParser::StringOrFloatAttrib &rhs)
needed for search comparison code
Definition: DtTextureAtlasIndexParser.h:160
DtOsgEarthFile.
Definition: DtOsgEarthFileParser.h:32
Contains DLL export macros.
std::string myType
Definition: DtOsgEarthFileParser.h:96