/usr/include/ossim/base/ossimXmlNode.h is in libossim-dev 1.8.16-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | //*******************************************************************
//
// License: See top level LICENSE.txt file.
//
// Author: Oscar Kramer <okramer@imagelinks.com> (ossim port by D. Burken)
//
// Description:
//
// Contains declaration of class ossimXmlNode.
//
//*****************************************************************************
// $Id: ossimXmlNode.h 12527 2008-03-04 17:02:55Z gpotts $
#ifndef ossimXmlNode_HEADER
#define ossimXmlNode_HEADER
#include <vector>
using namespace std;
#include <ossim/base/ossimObject.h>
#include <ossim/base/ossimRefPtr.h>
#include <ossim/base/ossimErrorStatusInterface.h>
#include <ossim/base/ossimXmlAttribute.h>
#include <ossim/base/ossimString.h>
class OSSIMDLLEXPORT ossimXmlNode : public ossimObject,
public ossimErrorStatusInterface
{
public:
typedef std::vector<ossimRefPtr<ossimXmlNode> > ChildListType;
typedef std::vector<ossimRefPtr<ossimXmlAttribute> > AttributeListType;
ossimXmlNode(istream& xml_stream, ossimXmlNode* parent=0);
ossimXmlNode();
ossimXmlNode(const ossimXmlNode& src);
virtual ossimObject* dup() const
{
return new ossimXmlNode(*this);
}
void duplicateAttributes(ossimXmlNode::AttributeListType result)const;
void duplicateChildren(ossimXmlNode::ChildListType& result)const;
bool read(std::istream& in);
// Appends any matching nodes to the list supplied
void findChildNodes(const ossimString& rel_xpath,
ossimXmlNode::ChildListType& nodelist)const;
const ossimRefPtr<ossimXmlNode> findFirstNode(const ossimString& rel_xpath)const;
ossimRefPtr<ossimXmlNode> findFirstNode(const ossimString& rel_xpath);
ossimRefPtr<ossimXmlAttribute> findAttribute(const ossimString& name);
const ossimRefPtr<ossimXmlAttribute> findAttribute(const ossimString& name)const;
void setTag(const ossimString& tag);
ossimString getTag() const;
const ossimXmlNode* getParentNode() const;
ossimXmlNode* getParentNode();
void setParent(ossimXmlNode* parent);
const ossimXmlNode::ChildListType& getChildNodes() const;
ossimXmlNode::ChildListType& getChildNodes();
const ossimXmlNode::AttributeListType& getAttributes() const;
bool getAttributeValue(ossimString& value, const ossimString& name)const;
ossimString getAttributeValue(const ossimString& name)const
{
ossimString value;
getAttributeValue(value, name);
return value;
}
bool getChildTextValue(ossimString& value,
const ossimString& relPath)const;
ossimString getChildTextValue(const ossimString& relPath)const
{
ossimString value;
getChildTextValue(value, relPath);
return value;
}
void addAttribute(ossimRefPtr<ossimXmlAttribute> attribute);
void addAttribute(const ossimString& name, const ossimString& value);
bool setAttribute(const ossimString& name,
const ossimString& value,
bool addIfNotPresentFlag=false);
ossimRefPtr<ossimXmlNode> addNode(const ossimString& relPath,
const ossimString& text = "");
ossimRefPtr<ossimXmlNode> addOrSetNode(const ossimString& relPath,
const ossimString& text = "");
void addChildNode(ossimRefPtr<ossimXmlNode> node);
ossimRefPtr<ossimXmlNode> addChildNode(const ossimString& tagName,
const ossimString& text="");
void addChildren(ossimXmlNode::ChildListType& children);
void setChildren(ossimXmlNode::ChildListType& children);
void addAttributes(ossimXmlNode::AttributeListType& children);
void setAttributes(ossimXmlNode::AttributeListType& children);
void setText(const ossimString& text);
const ossimString& getText() const;
bool cdataFlag()const;
void setCDataFlag(bool value);
OSSIMDLLEXPORT friend ostream& operator << (ostream& os, const ossimXmlNode* xml_node);
OSSIMDLLEXPORT friend ostream& operator << (ostream& os, const ossimXmlNode& xml_node);
ossimRefPtr<ossimXmlNode> removeChild(ossimRefPtr<ossimXmlNode> node);
ossimRefPtr<ossimXmlNode> removeChild(const ossimString& tag);
void clear();
void clearChildren();
void clearAttributes();
void toKwl(ossimKeywordlist& kwl,
const ossimString& prefix="")const;
void fromKwl(const ossimKeywordlist& kwlToConvert);
protected:
~ossimXmlNode();
bool readTag(std::istream& in,
ossimString& tag);
bool readTextContent(std::istream& in);
bool readEndTag(std::istream& in,
ossimString& endTag);
void skipCommentTag(std::istream& in);
bool readCDataContent(std::istream& in);
ossimString theTag;
ossimXmlNode* theParentNode;
vector<ossimRefPtr<ossimXmlNode> > theChildNodes;
vector<ossimRefPtr<ossimXmlAttribute> > theAttributes;
ossimString theText;
bool theCDataFlag;
/* ossimString theCData; */
TYPE_DATA
};
#endif /* #ifndef ossimXmlNode_HEADER */
|