GammaLib
2.1.0.dev
|
XML text node class. More...
#include <GXmlText.hpp>
Public Member Functions | |
GXmlText (void) | |
Void constructor. More... | |
GXmlText (const GXmlText &node) | |
Copy constructor. More... | |
GXmlText (const std::string &text) | |
Text constructor. More... | |
virtual | ~GXmlText (void) |
Destructor. More... | |
GXmlText & | operator= (const GXmlText &node) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear XML text. More... | |
virtual GXmlText * | clone (void) const |
Clone XML text. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual void | write (GUrl &url, const int &indent=0) const |
Write XML text 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 text. More... | |
const std::string & | text (void) const |
Return text. More... | |
void | text (const std::string &text) |
Set text. 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 GXmlText &node) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. 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_text |
Text. 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 text node class.
This class implements a text segment of a XML document.
Definition at line 43 of file GXmlText.hpp.
GXmlText::GXmlText | ( | void | ) |
Void constructor.
Definition at line 52 of file GXmlText.cpp.
References init_members().
Referenced by clone().
GXmlText::GXmlText | ( | const GXmlText & | node | ) |
Copy constructor.
[in] | node | XML text. |
Definition at line 67 of file GXmlText.cpp.
References copy_members(), and init_members().
|
explicit |
Text constructor.
[in] | text | Text string. |
Construct object by attributing a text string. Predefined entities (e.g. ") are automatically converted into normal characters.
Definition at line 88 of file GXmlText.cpp.
References init_members(), m_text, and gammalib::xml2str().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GXmlNode.
Definition at line 85 of file GXmlText.hpp.
|
virtual |
Clear XML text.
Resets the XML text to a clean initial state.
Implements GXmlNode.
Definition at line 161 of file GXmlText.cpp.
References free_members(), GXmlNode::free_members(), init_members(), and GXmlNode::init_members().
|
virtual |
Clone XML text.
Implements GXmlNode.
Definition at line 181 of file GXmlText.cpp.
References GXmlText().
|
protected |
Copy class members.
[in] | node | XML text. |
Definition at line 260 of file GXmlText.cpp.
References m_text.
Referenced by GXmlText(), and operator=().
|
protected |
Delete class members.
Definition at line 273 of file GXmlText.cpp.
Referenced by clear(), operator=(), and ~GXmlText().
|
protected |
Initialise class members.
Definition at line 245 of file GXmlText.cpp.
References m_text.
Referenced by clear(), GXmlText(), and operator=().
Assignment operator.
[in] | node | XML text. |
Definition at line 126 of file GXmlText.cpp.
References copy_members(), free_members(), init_members(), and GXmlNode::operator=().
|
virtual |
Print XML text.
[in] | chatter | Chattiness (defaults to NORMAL). |
[in] | indent | Text indentation (default to 0). |
Implements GXmlNode.
Definition at line 214 of file GXmlText.cpp.
References gammalib::fill(), m_text, and SILENT.
|
inline |
Return text.
Definition at line 97 of file GXmlText.hpp.
References m_text.
Referenced by GVOHub::get_callback_url(), GVOHub::get_client_key(), GVOHub::get_client_name(), GVOHub::get_subscriptions(), GVOHub::handle_request(), text(), GXmlElement::value(), and gammalib::xml_get_name_value_pair().
|
inline |
|
inlinevirtual |
Return XML node type.
Implements GXmlNode.
Definition at line 122 of file GXmlText.hpp.
References GXmlNode::NT_TEXT.
|
virtual |
Write XML text into URL.
[in] | url | Unified Resource Locator. |
[in] | indent | Text indentation (parameter ignored). |
Writes the text into the URL. Special characters are automatically transformed into predefined entities (e.g. ").
Implements GXmlNode.
Definition at line 197 of file GXmlText.cpp.
References m_text, GUrl::printf(), and gammalib::str2xml().
|
protected |
Text.
Definition at line 75 of file GXmlText.hpp.
Referenced by copy_members(), GXmlText(), init_members(), print(), text(), and write().