GammaLib
2.1.0.dev
|
XML Processing Instruction node class. More...
#include <GXmlPI.hpp>
Public Member Functions | |
GXmlPI (void) | |
Void constructor. More... | |
GXmlPI (const GXmlPI &node) | |
Copy constructor. More... | |
GXmlPI (const std::string &segment) | |
Segment constructor. More... | |
virtual | ~GXmlPI (void) |
Destructor. More... | |
GXmlPI & | operator= (const GXmlPI &node) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear XML Processing Instruction. More... | |
virtual GXmlPI * | clone (void) const |
Clone XML Processing Instruction. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual void | write (GUrl &url, const int &indent=0) const |
Write Processing Instruction into URL. More... | |
virtual NodeType | type (void) const |
Return XML node type. More... | |
virtual std::string | print (const GChatter &chatter=NORMAL, const int &indent=0) const |
Print XML Processing Instruction. More... | |
const std::string & | pi (void) const |
Return Processing Instruction. More... | |
void | pi (const std::string &pi) |
Set Processing Instruction. More... | |
Public Member Functions inherited from GXmlNode | |
GXmlNode (void) | |
Void constructor. More... | |
GXmlNode (const GXmlNode &node) | |
Copy constructor. More... | |
virtual | ~GXmlNode (void) |
Destructor. More... | |
GXmlNode & | operator= (const GXmlNode &node) |
Assignment operator. More... | |
GXmlNode * | operator[] (const int &index) |
Return pointer to XML child node. More... | |
const GXmlNode * | operator[] (const int &index) const |
Return pointer to XML child node (const version) More... | |
virtual int | size (void) const |
Return number of child nodes. More... | |
virtual bool | is_empty (void) const |
Signals if node has no child nodes. More... | |
virtual GXmlNode * | set (const int &index, const GXmlNode &node) |
Set XML child node. More... | |
virtual GXmlNode * | append (const GXmlNode &node) |
Append XML child node. More... | |
virtual GXmlElement * | append (const std::string &segment) |
Append XML element child node. More... | |
virtual GXmlNode * | insert (const int &index, const GXmlNode &node) |
Insert XML child node. More... | |
virtual void | remove (const int &index) |
Remove XML child node. More... | |
virtual void | reserve (const int &num) |
Reserve space for child nodes. More... | |
virtual void | extend (const GXmlNode &node) |
Append all XML child nodes from another XML node. More... | |
GXmlNode * | parent (void) const |
Return parent XML node. More... | |
void | parent (GXmlNode *parent) |
Set parent of XML node. More... | |
GFilename | filename (void) const |
Return filename of XML file. More... | |
virtual int | elements (void) const |
Return number of GXMLElement children of node. More... | |
virtual int | elements (const std::string &name) const |
Return number of GXMLElement children with a given name. More... | |
virtual GXmlElement * | element (const int &index) |
Return pointer to GXMLElement child. More... | |
virtual const GXmlElement * | element (const int &index) const |
Return pointer to GXMLElement child (const variant) More... | |
virtual GXmlElement * | element (const std::string &name) |
Return pointer on child walking down a hierarchy of tags. More... | |
virtual const GXmlElement * | element (const std::string &name) const |
Return pointer on child walking down a hierarchy of tags (const version) More... | |
virtual GXmlElement * | element (const std::string &name, const int &index) |
Return pointer on GXMLElement child of a given name. More... | |
virtual const GXmlElement * | element (const std::string &name, const int &index) const |
Return pointer on GXMLElement child of a given name (const variant) More... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print XML node in string. More... | |
Public Member Functions inherited from GContainer | |
virtual | ~GContainer (void) |
Destructor. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Protected Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GXmlPI &node) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
void | parse (const std::string &segment) |
Parse comment segment string. More... | |
Protected Member Functions inherited from GXmlNode | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GXmlNode &node) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
int | extract_index (std::string &tag) const |
Extract index from tag. More... | |
Protected Attributes | |
std::string | m_pi |
Processing instruction (without brackets) More... | |
Protected Attributes inherited from GXmlNode | |
GXmlNode * | m_parent |
Pointer on parent node. More... | |
std::vector< GXmlNode * > | m_nodes |
Pointer to child nodes. More... | |
Additional Inherited Members | |
Public Types inherited from GXmlNode | |
enum | NodeType { NT_DOCUMENT, NT_ELEMENT, NT_COMMENT, NT_UNKNOWN, NT_TEXT, NT_DECLARATION, NT_PI, NT_TYPECOUNT } |
XML Processing Instruction node class.
This class implements a XML Processing Instruction.
Definition at line 43 of file GXmlPI.hpp.
GXmlPI::GXmlPI | ( | void | ) |
Void constructor.
Definition at line 54 of file GXmlPI.cpp.
References init_members().
Referenced by clone().
GXmlPI::GXmlPI | ( | const GXmlPI & | node | ) |
Copy constructor.
[in] | node | XML Processing Instruction. |
Definition at line 69 of file GXmlPI.cpp.
References copy_members(), and init_members().
|
explicit |
Segment constructor.
[in] | segment | Text segment. |
Constructs a Processing Instruction from a text segment
.
Definition at line 89 of file GXmlPI.cpp.
References init_members(), and parse().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GXmlNode.
Definition at line 86 of file GXmlPI.hpp.
|
virtual |
Clear XML Processing Instruction.
Resets the XML Processing Instruction to an initial state.
Implements GXmlNode.
Definition at line 162 of file GXmlPI.cpp.
References free_members(), GXmlNode::free_members(), init_members(), and GXmlNode::init_members().
|
virtual |
Clone XML Processing Instruction.
Implements GXmlNode.
Definition at line 182 of file GXmlPI.cpp.
References GXmlPI().
|
protected |
Copy class members.
[in] | node | Processing Instruction. |
Definition at line 266 of file GXmlPI.cpp.
References m_pi.
Referenced by GXmlPI(), and operator=().
|
protected |
Delete class members.
Definition at line 279 of file GXmlPI.cpp.
Referenced by clear(), operator=(), and ~GXmlPI().
|
protected |
Initialise class members.
Definition at line 251 of file GXmlPI.cpp.
References m_pi.
Referenced by clear(), GXmlPI(), and operator=().
Assignment operator.
[in] | node | XML Processing Instruction. |
Definition at line 127 of file GXmlPI.cpp.
References copy_members(), free_members(), init_members(), and GXmlNode::operator=().
|
protected |
Parse comment segment string.
[in] | segment | Segment string. |
GException::invalid_value | XML syntax error. |
Parse the segment string.
Definition at line 296 of file GXmlPI.cpp.
Referenced by GXmlPI().
|
inline |
Return Processing Instruction.
Definition at line 98 of file GXmlPI.hpp.
References m_pi.
Referenced by pi().
|
inline |
Set Processing Instruction.
[in] | pi | Processing Instruction string. |
Definition at line 110 of file GXmlPI.hpp.
|
virtual |
Print XML Processing Instruction.
[in] | chatter | Chattiness (defaults to NORMAL). |
[in] | indent | Text indentation (default to 0). |
Implements GXmlNode.
Definition at line 220 of file GXmlPI.cpp.
References gammalib::fill(), m_pi, and SILENT.
|
inlinevirtual |
Return XML node type.
Implements GXmlNode.
Definition at line 123 of file GXmlPI.hpp.
References GXmlNode::NT_PI.
|
virtual |
Write Processing Instruction into URL.
[in] | url | Unified Resource Locator. |
[in] | indent | Text indentation (default = 0). |
Writes a Processing Instruction into a url
object.
Implements GXmlNode.
Definition at line 197 of file GXmlPI.cpp.
References m_pi, and GUrl::printf().
|
protected |
Processing instruction (without brackets)
Definition at line 76 of file GXmlPI.hpp.
Referenced by copy_members(), init_members(), parse(), pi(), print(), and write().