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);
170 void modifyTextNode(osgEarth::XmlElement* element,
const std::string& text);
173 std::set<std::string> getUniqueChildKeysOfConfig(
const osgEarth::Config& config)
const;
176 std::set<std::string> getUniqueChildKeysOfElement(
const osgEarth::Util::XmlElement* element)
const;
180 std::string findNameOfConfig(
const osgEarth::Config& config);
183 virtual bool checkExternalReference(
const std::string& text);
188 virtual bool findUrl(
const std::string& text, std::string& url);
194 virtual bool isXmlInclude(
const std::string& url)
const;
197 virtual void parseExternalReference(
const std::string& text);
210 std::vector< std::pair<std::string, std::string> > getXmlElementNodes()
const;
215 virtual XmlElementKey getXmlElementKey(
const osgEarth::XmlElement* parent,
const osgEarth::XmlElement* element)
const;
218 virtual osgEarth::XmlElement* root();
235 virtual bool findXmlElementKey(osgEarth::Util::XmlElement* element,
const std::string& type,
const std::string& name,
239 virtual void setFileName(
const DtUnicode& fileName);
245 virtual void save(
const DtUnicode& fileName);
248 virtual std::string getXmlElementType(
const osgEarth::Util::XmlElement* element)
const;
255 virtual int getXmlElementIndex(
const osgEarth::Util::XmlElement* parent,
const osgEarth::Util::XmlElement* element)
const;
258 virtual std::string getXmlElementName(
const osgEarth::Util::XmlElement* element)
const;
261 DtOsgEarthFile* findOsgEarthFile(
const std::string& type,
const std::string& name);
266 virtual void processXmlNode(
const osgEarth::Util::XmlNode* node);
269 virtual void processXmlElement(
const osgEarth::Util::XmlElement* element);
272 virtual void processXmlText(
const osgEarth::Util::XmlText* text);
279 void addOrModifyConfig(
size_t startPos, osgEarth::XmlElement* element,
const osgEarth::Config& config,
int index);
287 void addOrModifySimpleConfig(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& value,
int index);
294 void addOrModifyNonSimpleConfig(
size_t startPos, osgEarth::Util::XmlElement* element,
const osgEarth::Config& config,
int index);
301 virtual bool modifyXmlAttribute(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue);
307 virtual bool removeXmlAttribute(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key);
314 virtual bool removeXmlElement(
size_t startPos, osgEarth::Util::XmlElement* parent,
const std::string& key,
int index);
322 virtual bool moveXmlElement(
size_t startPos, osgEarth::Util::XmlElement* parent,
const std::string& key,
int index,
int newIndex);
330 virtual bool modifyXmlSimpleElement(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue,
int index);
337 virtual bool addXmlAttribute(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue);
345 virtual bool addXmlSimpleElement(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue,
int index);
352 virtual bool addXmlNonSimpleElement(
size_t startPos, osgEarth::Util::XmlElement* element,
const osgEarth::Config& config,
int index);
358 virtual bool addXmlTextNode(
size_t startPos, osgEarth::Util::XmlElement* element,
const std::string& text);
362 virtual std::string getConfigString(
const osgEarth::Config& config);
367 virtual std::string getXmlAttributeString(
const std::string& key,
const std::string& value);
372 virtual std::string getSimpleConfigString(
const std::string& key,
const std::string& value);
378 virtual void updateAttribute(osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue);
384 virtual void removeAttribute(osgEarth::Util::XmlElement* element,
const std::string& key);
390 virtual void removeElement(osgEarth::Util::XmlElement* element,
const std::string& key,
int index);
397 virtual void updateSimpleElement(osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue,
int index);
403 virtual void addAttribute(osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& value);
409 virtual void addSimpleElement(osgEarth::Util::XmlElement* element,
const std::string& key,
const std::string& newValue);
415 virtual void addNonSimpleElement(osgEarth::Util::XmlElement* element, osgEarth::Util::XmlElement* child);
420 virtual void addTextNode(osgEarth::Util::XmlElement* element,
const std::string& text);
426 virtual bool hasAttribute(
const osgEarth::Util::XmlElement* element,
const std::string& key);
433 virtual osgEarth::XmlElement* findSubElement(
const osgEarth::Util::XmlElement* element,
const std::string& key,
int index);
438 virtual int findSubElementMaximumIndex(
const osgEarth::XmlElement* element,
const std::string& key);
444 virtual bool hasChild(
const osgEarth::Config& config,
const std::string& key,
int index);
450 virtual size_t findStartPos(
size_t startPos,
const osgEarth::Util::XmlElement* element,
const XmlElementKey& key);
453 virtual std::string getElementStartPattern(
const std::string& key)
const;
456 virtual std::string getElementEndPattern(
const osgEarth::Util::XmlElement* element)
const;
459 virtual std::string getElementEndPattern(
const std::string& key)
const;
462 virtual std::string getAttributeStartPattern(
const std::string& key)
const;
469 virtual bool getAttributeValue(
size_t startPos,
size_t endPos,
const std::string& key, std::string& value)
const;
476 virtual bool getElementValue(
size_t startPos,
size_t endPos,
const std::string& key, std::string& value)
const;
480 std::string formatValue(
const std::string& value)
const;
484 virtual bool isReservedKeyWord(
const std::string& key)
const;
493 virtual bool ifElementHasChild(osgEarth::Util::XmlElement* root,
const std::string& type,
const std::string& name,
int currentDepth = 0,
int maxDepth = 2);
525 virtual void parse(
const DtUnicode& fileName);
531 virtual void addConfig(
const std::string& parentType,
const std::string& parentName,
const osgEarth::Config& config);
536 virtual void removeConfig(
const std::string& type,
const std::string& name);
542 virtual void moveConfig(
const std::string& type,
const std::string& name,
int newIndex);
548 virtual void updateConfig(
const std::string& name,
const std::string& type,
const osgEarth::Config& config);
554 virtual void updateName(
const std::string& oldName,
const std::string& type,
const std::string& newName);
559 virtual void modifyConfig(
const std::string& name,
const osgEarth::Config& config);
570 virtual bool hasExternalFiles()
const;
574 virtual void save(
const DtUnicode& fileName);
578 virtual void setRootFileName(
const DtUnicode& fileName);
XmlElementKey.
Definition: DtOsgEarthFileParser.h:43
DtOsgEarthFileParser.
Definition: DtOsgEarthFileParser.h:513
osgEarth::Util::XmlElement * myRoot
Definition: DtOsgEarthFileParser.h:504
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:581
DtUnicode myFileName
Definition: DtOsgEarthFileParser.h:508
bool operator==(const DtMilStdKeyParams &a, const DtMilStdKeyParams &b)
Memberwise equality for DtMilStdKeyParams. Used by callers (e.g. DtMilStdIconVisualizer) to skip key ...
Definition: DtMilStdManagerInterface.h:58
std::string myModifiedText
Definition: DtOsgEarthFileParser.h:506
ExternalFileList myExternalFileList
Definition: DtOsgEarthFileParser.h:505
std::string myOriginalText
Definition: DtOsgEarthFileParser.h:507
DtOsgEarthFile.
Definition: DtOsgEarthFileParser.h:32
Contains DLL export macros.
std::string myType
Definition: DtOsgEarthFileParser.h:96