![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Wrapper around TiXmlElement. More...
#include <ticpp.h>
Public Member Functions | |
| Element () | |
| Default Constructor. | |
| Element (const std::string &value) | |
| Default Constructor. | |
| Element (const char *value) | |
| Default Constructor. | |
| Element (TiXmlElement *element) | |
| Constructor. | |
| template<class T> | |
| Element (const std::string &value, const T &text) | |
| Constructor that allows you to set the element text. | |
| Attribute * | FirstAttribute (bool throwIfNoAttributes=true) const |
| Access the first attribute in this element. | |
| Attribute * | LastAttribute (bool throwIfNoAttributes=true) const |
| Access the last attribute in this element. | |
| void | IterateFirst (const std::string &, Attribute **first) const |
| template<class T> | |
| void | SetAttribute (const std::string &name, const T &value) |
| Sets an attribute of name to a given value. | |
| std::string | GetText (bool throwIfNotFound=true) const |
| Gets the text of an Element. | |
| std::string | GetTextOrDefault (const std::string &defaultValue) const |
| Gets the text of an Element, if it doesn't exist it will return the defaultValue. | |
| template<class T, class DefaultT> | |
| void | GetTextOrDefault (T *value, const DefaultT &defaultValue) const |
| Gets the text value of an Element, if it doesn't exist it will return the defaultValue. | |
| template<class T> | |
| void | GetText (T *value, bool throwIfNotFound=true) const |
| Gets the text of an Element. | |
| template<class T> | |
| void | SetText (const T &value) |
| Convenience function to set the text of an element. | |
| template<class T, class DefaulT> | |
| void | GetAttributeOrDefault (const std::string &name, T *value, const DefaulT &defaultValue) const |
| Gets an attribute of name from an element, if it doesn't exist it will return the defaultValue. | |
| std::string | GetAttributeOrDefault (const std::string &name, const std::string &defaultValue) const |
| Gets an attribute of name from an element, if it doesn't exist it will return the defaultValue. | |
| template<class T> | |
| T | GetAttribute (const std::string &name, bool throwIfNotFound=true) const |
| Returns an attribute of name from an element. | |
| template<class T> | |
| void | GetAttribute (const std::string &name, T *value, bool throwIfNotFound=true) const |
| Gets an attribute of name from an element. | |
| std::string | GetAttribute (const std::string &name) const |
| Gets an attribute of name from an element. | |
| bool | HasAttribute (const std::string &name) const |
| Returns true, if attribute exists. | |
| void | RemoveAttribute (const std::string &name) |
| Removes attribute from element. | |
| template<class T> | |
| void | GetValue (T *value) const |
| Get the value of this node Uses Base::FromString to convert TiXmlNode::ValueStr from a std::string, and puts it in the passed pointer. | |
| std::string | Value () const |
| Get the value of this node. | |
| template<class T> | |
| void | SetValue (const T &value) |
| Set the value of this node. | |
| void | Clear () |
| Clear all Nodes below this. | |
| Node * | Parent (bool throwIfNoParent=true) const |
| The Parent of this Node. | |
| Node * | FirstChild (bool throwIfNoChildren=true) const |
| The first child of this node. | |
| Node * | FirstChild (const char *value, bool throwIfNoChildren=true) const |
| Node * | FirstChild (const std::string &value, bool throwIfNoChildren=true) const |
| The first child of this node with the matching value. | |
| Node * | LastChild (bool throwIfNoChildren=true) const |
| The last child of this node. | |
| Node * | LastChild (const char *value, bool throwIfNoChildren=true) const |
| Node * | LastChild (const std::string &value, bool throwIfNoChildren=true) const |
| The last child of this node with the matching value. | |
| Node * | IterateChildren (Node *previous) const |
| An alternate way to walk the children of a node. | |
| Node * | IterateChildren (const std::string &value, Node *previous) const |
| This flavor of IterateChildren searches for children with a particular value. | |
| Node * | InsertEndChild (Node &addThis) |
| Adds a child past the LastChild. | |
| Node * | LinkEndChild (Node *childNode) |
| Adds a child past the LastChild. | |
| Node * | InsertBeforeChild (Node *beforeThis, Node &addThis) |
| Adds a child before the specified child. | |
| Node * | InsertAfterChild (Node *afterThis, Node &addThis) |
| Adds a child after the specified child. | |
| Node * | ReplaceChild (Node *replaceThis, Node &withThis) |
| Replace a child of this node. | |
| void | RemoveChild (Node *removeThis) |
| Delete a child of this node. | |
| Node * | PreviousSibling (bool throwIfNoSiblings=true) const |
| Navigate to a sibling node. | |
| Node * | PreviousSibling (const std::string &value, bool throwIfNoSiblings=true) const |
| Navigate to a sibling node with the given value. | |
| Node * | PreviousSibling (const char *value, bool throwIfNoSiblings=true) const |
| Node * | NextSibling (bool throwIfNoSiblings=true) const |
| Navigate to a sibling node. | |
| Node * | NextSibling (const std::string &value, bool throwIfNoSiblings=true) const |
| Navigate to a sibling node with the given value. | |
| Node * | NextSibling (const char *value, bool throwIfNoSiblings=true) const |
| template<class T> | |
| void | IterateFirst (const std::string &value, T **first) const |
| template<class T> | |
| void | IterateNext (const std::string &value, T **next) const |
| template<class T> | |
| void | IteratePrevious (const std::string &value, T **previous) const |
| Element * | NextSiblingElement (bool throwIfNoSiblings=true) const |
| Navigate to a sibling element. | |
| Element * | NextSiblingElement (const std::string &value, bool throwIfNoSiblings=true) const |
| Navigate to a sibling element with the given value. | |
| Element * | NextSiblingElement (const char *value, bool throwIfNoSiblings=true) const |
| Element * | FirstChildElement (bool throwIfNoChildren=true) const |
| The first child element of this node. | |
| Element * | FirstChildElement (const char *value, bool throwIfNoChildren=true) const |
| Element * | FirstChildElement (const std::string &value, bool throwIfNoChildren=true) const |
| The first child element of this node with the matching value. | |
| int | Type () const |
| Query the type (as TiXmlNode::NodeType ) of this node. | |
| Document * | GetDocument (bool throwIfNoDocument=true) const |
| Return a pointer to the Document this node lives in. | |
| bool | NoChildren () const |
| Check if this node has no children. | |
| template<class T> | |
| T * | To () const |
| Pointer conversion ( NOT OBJECT CONVERSION ) - replaces TiXmlNode::ToElement, TiXmlNode::ToDocument, TiXmlNode::ToComment, etc. | |
| Document * | ToDocument () const |
| Pointer conversion - replaces TiXmlNode::ToDocument. | |
| Element * | ToElement () const |
| Pointer conversion - replaces TiXmlNode::ToElement. | |
| Comment * | ToComment () const |
| Pointer conversion - replaces TiXmlNode::ToComment. | |
| Text * | ToText () const |
| Pointer conversion - replaces TiXmlNode::ToText. | |
| Declaration * | ToDeclaration () const |
| Pointer conversion - replaces TiXmlNode::ToDeclaration. | |
| StylesheetReference * | ToStylesheetReference () const |
| Pointer conversion - replaces TiXmlNode::ToStylesheetReference. | |
| std::unique_ptr< Node > | Clone () const |
| Create an exact duplicate of this node and return it. | |
| bool | Accept (TiXmlVisitor *visitor) const |
| Accept a hierchical visit the nodes in the TinyXML DOM. | |
| template<class T> | |
| std::string | ToString (const T &value) const |
| Converts any class with a proper overload of the << opertor to a std::string. | |
| std::string | ToString (const std::string &value) const |
| template<class T> | |
| void | FromString (const std::string &temp, T *out) const |
| Converts a std::string to any class with a proper overload of the >> opertor. | |
| void | FromString (const std::string &temp, std::string *out) const |
| Specialization for std::string. | |
| int | Row () const |
| Return the position, in the original source file, of this node or attribute. | |
| int | Column () const |
| Return the position, in the original source file, of this node or attribute. | |
| bool | operator== (const Base &rhs) const |
| Compare internal TiXml pointers to determine is both are wrappers around the same node. | |
| bool | operator!= (const Base &rhs) const |
| Compare internal TiXml pointers to determine is both are wrappers around the same node. | |
| std::string | BuildDetailedErrorString () const |
| Builds detailed error string using TiXmlDocument::Error() and others. | |
Protected Member Functions | |
| TiXmlNode * | GetTiXmlPointer () const |
| void | SetTiXmlPointer (TiXmlElement *newPointer) |
| TiXmlBase * | GetBasePointer () const |
| Node * | NodeFactory (TiXmlNode *tiXmlNode, bool throwIfNull=true, bool rememberSpawnedWrapper=true) const |
| void | SetImpRC (TiXmlBase *nodeBase) |
| void | ValidatePointer () const |
Protected Attributes | |
| TiXmlElement * | m_tiXmlPointer |
| Internal pointer to the TiXml Class which is being wrapped. | |
| TiCppRCImp * | m_impRC |
| Holds status of internal TiXmlPointer - use this to determine if object has been deleted already. | |
Private Member Functions | |
| bool | GetAttributeImp (const std::string &name, std::string *value) const |
| bool | GetTextImp (std::string *value) const |
Wrapper around TiXmlElement.
| Element::Element | ( | ) |
Default Constructor.
Definition at line 747 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::NodeImp(), and ticpp::NodeImp< TiXmlElement >::m_impRC.
| Element::Element | ( | const std::string & | value | ) |
Default Constructor.
Initializes all the variables.
| value | The value of the element. |
Definition at line 753 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::NodeImp(), and ticpp::NodeImp< TiXmlElement >::m_impRC.
| Element::Element | ( | const char * | value | ) |
Default Constructor.
Initializes all the variables.
| value | The value of the element. |
Definition at line 758 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::NodeImp(), and ticpp::NodeImp< TiXmlElement >::m_impRC.
| Element::Element | ( | TiXmlElement * | element | ) |
Constructor.
Definition at line 763 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::NodeImp().
|
inline |
Constructor that allows you to set the element text.
| value | The value of the element. |
| text | The text to set. |
Definition at line 1533 of file ticpp.h.
References ticpp::NodeImp< TiXmlElement >::NodeImp(), ticpp::NodeImp< TiXmlElement >::m_impRC, and SetText().
|
inherited |
Accept a hierchical visit the nodes in the TinyXML DOM.
Definition at line 650 of file ticpp.cpp.
References TiXmlNode::Accept(), and GetTiXmlPointer().
|
inlineinherited |
Builds detailed error string using TiXmlDocument::Error() and others.
Definition at line 238 of file ticpp.h.
References TiXmlDocument::Error(), TiXmlDocument::ErrorCol(), TiXmlDocument::ErrorDesc(), TiXmlDocument::ErrorRow(), GetBasePointer(), TiXmlNode::GetDocument(), and TiXmlNode::Value().
|
inherited |
Clear all Nodes below this.
Simple wrapper for TiXmlNode::Clear.
Definition at line 232 of file ticpp.cpp.
References TiXmlNode::Clear(), and GetTiXmlPointer().
|
inherited |
Create an exact duplicate of this node and return it.
Definition at line 635 of file ticpp.cpp.
References TiXmlNode::Clone(), GetTiXmlPointer(), and TICPPTHROW.
|
inlineinherited |
Return the position, in the original source file, of this node or attribute.
Wrapper around TiXmlBase::Row()
Definition at line 215 of file ticpp.h.
References TiXmlBase::Column(), and GetBasePointer().
Access the first attribute in this element.
| throwIfNoAttributes | [DEF] If true, throws when there are no attributes |
Definition at line 766 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::m_tiXmlPointer, TICPPTHROW, ticpp::NodeImp< TiXmlElement >::ValidatePointer(), and ticpp::NodeImp< TiXmlElement >::Value().
Referenced by IterateFirst().
The first child of this node.
| throwIfNoChildren | [DEF] If true, will throw an exception if there are no children. |
| Exception | When throwIfNoChildren is true, and TiXmlNode::FirstChild returns Null. |
Definition at line 244 of file ticpp.cpp.
References FirstChild().
Referenced by FirstChild(), FirstChild(), and IterateFirst().
Definition at line 252 of file ticpp.cpp.
References TiXmlNode::FirstChild(), GetTiXmlPointer(), NodeFactory(), and TICPPTHROW.
|
inherited |
The first child of this node with the matching value.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| value | Value to match. |
| throwIfNoChildren | [DEF] If true, will throw an exception if there are no children. |
Definition at line 248 of file ticpp.cpp.
References FirstChild().
The first child element of this node.
| throwIfNoChildren | [DEF] If true, will throw an exception if there are no element children. |
| Exception | When throwIfNoChildren is true, and TiXmlNode::FirstChildElement returns Null. |
Definition at line 501 of file ticpp.cpp.
References FirstChildElement().
Referenced by FirstChildElement(), and FirstChildElement().
|
inherited |
Definition at line 510 of file ticpp.cpp.
References TiXmlNode::FirstChildElement(), GetTiXmlPointer(), TICPPTHROW, and Value().
|
inherited |
The first child element of this node with the matching value.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| value | Value to match. |
| throwIfNoChildren | [DEF] If true, will throw an exception if there are no element children. |
Definition at line 505 of file ticpp.cpp.
References FirstChildElement().
|
inlineinherited |
|
inlineinherited |
Converts a std::string to any class with a proper overload of the >> opertor.
| temp | The string to be converted |
| out | [OUT] The container for the returned value |
| Exception | When temp cannot be converted to the target type |
Definition at line 189 of file ticpp.h.
References TICPPTHROW.
Referenced by ticpp::Attribute::GetName(), ticpp::Attribute::GetValue(), and ticpp::Node::GetValue().
| std::string Element::GetAttribute | ( | const std::string & | name | ) | const |
Gets an attribute of name from an element.
Returns an empty string if the attribute does not exist.
| name | The name of the attribute you are querying. |
Definition at line 821 of file ticpp.cpp.
References GetAttributeOrDefault().
|
inline |
Returns an attribute of name from an element.
Uses FromString to convert the string to the type of choice.
| name | The name of the attribute you are querying. |
| throwIfNotFound | [DEF] If true, will throw an exception if the attribute doesn't exist |
| Exception | When the attribute doesn't exist and throwIfNotFound is true |
Definition at line 1799 of file ticpp.h.
References ticpp::NodeImp< TiXmlElement >::FromString(), GetAttributeImp(), and TICPPTHROW.
|
inline |
Gets an attribute of name from an element.
Uses FromString to convert the string to the type of choice.
| name | The name of the attribute you are querying. |
| value | [OUT] The container for the returned value |
| throwIfNotFound | [DEF] If true, will throw an exception if the attribute doesn't exist |
| Exception | When the attribute doesn't exist and throwIfNotFound is true |
Definition at line 1833 of file ticpp.h.
References ticpp::NodeImp< TiXmlElement >::FromString(), GetAttributeImp(), and TICPPTHROW.
|
private |
Definition at line 835 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::m_tiXmlPointer, and ticpp::NodeImp< TiXmlElement >::ValidatePointer().
Referenced by GetAttribute(), GetAttribute(), GetAttributeOrDefault(), and GetAttributeOrDefault().
| std::string Element::GetAttributeOrDefault | ( | const std::string & | name, |
| const std::string & | defaultValue ) const |
Gets an attribute of name from an element, if it doesn't exist it will return the defaultValue.
| name | The name of the attribute you are querying. |
| defaultValue | What to put in value if there is no attribute in this element. |
Definition at line 810 of file ticpp.cpp.
References GetAttributeImp().
|
inline |
Gets an attribute of name from an element, if it doesn't exist it will return the defaultValue.
Uses FromString to convert the string to the type of choice.
| name | The name of the attribute you are querying. |
| value | [OUT] The container for the returned value. |
| defaultValue | What to put in value if there is no attribute in this element. |
| Exception |
Definition at line 1756 of file ticpp.h.
References ticpp::NodeImp< TiXmlElement >::FromString(), and GetAttributeImp().
Referenced by GetAttribute().
|
inlineprotectedvirtualinherited |
Implements ticpp::Base.
Definition at line 1073 of file ticpp.h.
References GetTiXmlPointer().
Return a pointer to the Document this node lives in.
| throwIfNoDocument | [DEF] If true, will throw an exception if this node is not linked under a Document. |
Definition at line 538 of file ticpp.cpp.
|
inline |
Gets the text of an Element.
| throwIfNotFound | [DEF] If true, will throw an exception if there is no text in this element |
| Exception | When there is no text and throwIfNotFound is true |
Definition at line 1610 of file ticpp.h.
References GetTextImp(), and TICPPTHROW.
|
inline |
Gets the text of an Element.
Uses FromString to convert the string to the type of choice.
| value | [OUT] The container for the returned value |
| throwIfNotFound | [DEF] If true, will throw an exception if there is no text in this element |
| Exception | When there is no text and throwIfNotFound is true |
Definition at line 1700 of file ticpp.h.
References ticpp::NodeImp< TiXmlElement >::FromString(), GetTextImp(), and TICPPTHROW.
|
private |
Definition at line 850 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::m_tiXmlPointer, and ticpp::NodeImp< TiXmlElement >::ValidatePointer().
Referenced by GetText(), GetText(), GetTextOrDefault(), and GetTextOrDefault().
|
inline |
Gets the text of an Element, if it doesn't exist it will return the defaultValue.
| defaultValue | What to put in 'value' if there is no text in this element |
Definition at line 1636 of file ticpp.h.
References GetTextImp().
|
inline |
Gets the text value of an Element, if it doesn't exist it will return the defaultValue.
Uses FromString to convert the string to the type of choice
| value | [OUT] The container for the returned value |
| defaultValue | What to put in 'value' if there is no text in this element |
Definition at line 1666 of file ticpp.h.
References ticpp::NodeImp< TiXmlElement >::FromString(), and GetTextImp().
|
inlineprotectedvirtualinherited |
Implements ticpp::Node.
|
inlineinherited |
Get the value of this node Uses Base::FromString to convert TiXmlNode::ValueStr from a std::string, and puts it in the passed pointer.
| value | [OUT] A pointer to fill with the value |
Definition at line 470 of file ticpp.h.
References ticpp::Base::FromString(), and GetTiXmlPointer().
| bool Element::HasAttribute | ( | const std::string & | name | ) | const |
Returns true, if attribute exists.
| name | The name of the attribute you are checking. |
Definition at line 825 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::m_tiXmlPointer, and ticpp::NodeImp< TiXmlElement >::ValidatePointer().
Adds a child after the specified child.
Throws if you try to insert a document.
| Exception | When TiXmlNode::InsertAfterChild returns Null. |
Definition at line 365 of file ticpp.cpp.
References TiXmlNode::DOCUMENT, GetTiXmlPointer(), TiCppRCImp::IncRef(), TiXmlNode::InsertAfterChild(), ticpp::Base::m_impRC, NodeFactory(), TICPPTHROW, and Type().
Adds a child before the specified child.
Throws if you try to insert a document.
| Exception | When TiXmlNode::InsertBeforeChild returns Null. |
Definition at line 347 of file ticpp.cpp.
References TiXmlNode::DOCUMENT, GetTiXmlPointer(), TiCppRCImp::IncRef(), TiXmlNode::InsertBeforeChild(), ticpp::Base::m_impRC, NodeFactory(), TICPPTHROW, and Type().
Adds a child past the LastChild.
Throws if you try to insert a document.
| addThis | Node to insert. |
| Exception | When TiXmlNode::InsertEndChild returns Null |
Definition at line 317 of file ticpp.cpp.
References TiXmlNode::DOCUMENT, GetTiXmlPointer(), TiXmlNode::InsertEndChild(), NodeFactory(), TICPPTHROW, and Type().
This flavor of IterateChildren searches for children with a particular value.
Simple wrapper for TiXmlNode::IterateChildren.
| value | The value you want to search for. |
| previous | The previous Node* that was returned from IterateChildren. |
Definition at line 304 of file ticpp.cpp.
References GetTiXmlPointer(), TiXmlNode::IterateChildren(), and NodeFactory().
An alternate way to walk the children of a node.
Simple wrapper for TiXmlNode::IterateChildren.
| previous | The previous Node* that was returned from IterateChildren. |
Definition at line 292 of file ticpp.cpp.
References GetTiXmlPointer(), TiXmlNode::IterateChildren(), and NodeFactory().
|
inlinevirtual |
Reimplemented from ticpp::Node.
Definition at line 1568 of file ticpp.h.
References FirstAttribute(), and ticpp::Attribute::Next().
|
inlineinherited |
Definition at line 783 of file ticpp.h.
References FirstChild(), and NextSibling().
Referenced by ticpp::Iterator< T >::begin().
|
inlineinherited |
Definition at line 808 of file ticpp.h.
References NextSibling().
|
inlineinherited |
Definition at line 826 of file ticpp.h.
References PreviousSibling().
Access the last attribute in this element.
| throwIfNoAttributes | [DEF] If true, throws when there are no attributes |
Definition at line 788 of file ticpp.cpp.
References TiCppRC::m_spawnedWrappers, ticpp::NodeImp< TiXmlElement >::m_tiXmlPointer, TICPPTHROW, ticpp::NodeImp< TiXmlElement >::ValidatePointer(), and ticpp::NodeImp< TiXmlElement >::Value().
The last child of this node.
| throwIfNoChildren | [DEF] If true, will throw an exception if there are no children. |
| Exception | When throwIfNoChildren is true, and TiXmlNode::LastChild returns Null. |
Definition at line 268 of file ticpp.cpp.
References LastChild().
Referenced by LastChild(), and LastChild().
Definition at line 276 of file ticpp.cpp.
References GetTiXmlPointer(), TiXmlNode::LastChild(), NodeFactory(), and TICPPTHROW.
The last child of this node with the matching value.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| value | Value to match. |
| throwIfNoChildren | [DEF] If true, will throw an exception if there are no children. |
Definition at line 272 of file ticpp.cpp.
References LastChild().
Adds a child past the LastChild.
Throws if you try to link a document.
| childNode | Node to link. |
| Exception | When TiXmlNode::LinkEndChild returns Null. |
Definition at line 332 of file ticpp.cpp.
References TiXmlNode::DOCUMENT, GetTiXmlPointer(), TiCppRCImp::IncRef(), LinkEndChild(), ticpp::Base::m_impRC, TICPPTHROW, and Type().
Referenced by LinkEndChild().
Navigate to a sibling node.
Wrapper around TiXmlNode::NextSibling.
| throwIfNoSiblings | [DEF] If true, will throw an exception if there are no siblings. |
| Exception | When TiXmlNode::NextSibling returns Null and 'throwIfNoSiblings' is true. |
Definition at line 438 of file ticpp.cpp.
References NextSibling().
Referenced by IterateFirst(), IterateNext(), NextSibling(), and NextSibling().
Definition at line 446 of file ticpp.cpp.
References GetTiXmlPointer(), TiXmlNode::NextSibling(), NodeFactory(), TICPPTHROW, and Value().
|
inherited |
Navigate to a sibling node with the given value.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| value | The value of the node to look for. |
| throwIfNoSiblings | [DEF] If true, will throw an exception if there are no siblings. |
Definition at line 442 of file ticpp.cpp.
References NextSibling().
Navigate to a sibling element.
Wrapper around TiXmlNode::NextSibling.
| throwIfNoSiblings | [DEF] If true, will throw an exception if there are no sibling element. |
| Exception | When TiXmlNode::NextSibling returns Null and 'throwIfNoSiblings' is true. |
Definition at line 464 of file ticpp.cpp.
References NextSiblingElement().
Referenced by NextSiblingElement(), and NextSiblingElement().
|
inherited |
Definition at line 473 of file ticpp.cpp.
References GetTiXmlPointer(), and TiXmlNode::NextSiblingElement().
|
inherited |
Navigate to a sibling element with the given value.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| value | The value of the element to look for. |
| throwIfNoSiblings | [DEF] If true, will throw an exception if there are no sibling elements. |
Definition at line 468 of file ticpp.cpp.
References NextSiblingElement().
|
inherited |
Check if this node has no children.
Definition at line 555 of file ticpp.cpp.
References GetTiXmlPointer(), and TiXmlNode::NoChildren().
|
protectedinherited |
Definition at line 181 of file ticpp.cpp.
References TiXmlNode::COMMENT, TiXmlNode::DECLARATION, TiXmlNode::DOCUMENT, TiXmlNode::ELEMENT, TiCppRC::m_spawnedWrappers, TiXmlNode::STYLESHEETREFERENCE, TiXmlNode::TEXT, TICPPTHROW, TiXmlNode::ToComment(), TiXmlNode::ToDeclaration(), TiXmlNode::ToDocument(), TiXmlNode::ToElement(), TiXmlNode::ToStylesheetReference(), TiXmlNode::ToText(), and TiXmlNode::Type().
Referenced by FirstChild(), InsertAfterChild(), InsertBeforeChild(), InsertEndChild(), IterateChildren(), IterateChildren(), LastChild(), NextSibling(), Parent(), PreviousSibling(), and ReplaceChild().
Compare internal TiXml pointers to determine is both are wrappers around the same node.
Definition at line 231 of file ticpp.h.
References GetBasePointer().
Compare internal TiXml pointers to determine is both are wrappers around the same node.
Definition at line 222 of file ticpp.h.
References GetBasePointer().
The Parent of this Node.
Simple wrapper for TiXmlNode::Parent.
| throwIfNoParent | [DEF] If true, throws when Parent = nullptr. |
| Exception | When throwIfNoParent is true, and TiXmlNode::Parent returns Null. |
Definition at line 234 of file ticpp.cpp.
References GetTiXmlPointer(), NodeFactory(), TiXmlNode::Parent(), and TICPPTHROW.
Navigate to a sibling node.
Wrapper around TiXmlNode::PreviousSibling.
| throwIfNoSiblings | [DEF] If true, will throw an exception if there are no siblings. |
| Exception | When TiXmlNode::PreviousSibling returns Null and 'throwIfNoSiblings' is true. |
Definition at line 410 of file ticpp.cpp.
References PreviousSibling().
Referenced by IteratePrevious(), PreviousSibling(), and PreviousSibling().
Definition at line 419 of file ticpp.cpp.
References GetTiXmlPointer(), NodeFactory(), TiXmlNode::PreviousSibling(), TICPPTHROW, and Value().
|
inherited |
Navigate to a sibling node with the given value.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| value | The value of the node to look for. |
| throwIfNoSiblings | [DEF] If true, will throw an exception if there are no siblings. |
Definition at line 414 of file ticpp.cpp.
References PreviousSibling().
| void Element::RemoveAttribute | ( | const std::string & | name | ) |
Removes attribute from element.
| name | The name of the attribute to remove. |
Definition at line 830 of file ticpp.cpp.
References ticpp::NodeImp< TiXmlElement >::m_tiXmlPointer, and ticpp::NodeImp< TiXmlElement >::ValidatePointer().
|
inherited |
Delete a child of this node.
| removeThis | Node to delete. |
Definition at line 401 of file ticpp.cpp.
References GetTiXmlPointer(), RemoveChild(), TICPPTHROW, and Value().
Referenced by RemoveChild().
Replace a child of this node.
Throws if you try to replace with a document.
| Exception | When TiXmlNode::ReplaceChild returns Null. |
Definition at line 383 of file ticpp.cpp.
References TiXmlNode::DOCUMENT, GetTiXmlPointer(), TiCppRCImp::IncRef(), ticpp::Base::m_impRC, NodeFactory(), TiXmlNode::ReplaceChild(), TICPPTHROW, and Type().
|
inlineinherited |
Return the position, in the original source file, of this node or attribute.
Wrapper around TiXmlBase::Row()
Definition at line 209 of file ticpp.h.
References GetBasePointer(), and TiXmlBase::Row().
|
inline |
Sets an attribute of name to a given value.
The attribute will be created if it does not exist, or changed if it does. Uses ToString to convert the value to a string, so there is no need to use any other SetAttribute methods.
Definition at line 1591 of file ticpp.h.
References ticpp::NodeImp< TiXmlElement >::m_tiXmlPointer, ticpp::NodeImp< TiXmlElement >::ToString(), and ticpp::NodeImp< TiXmlElement >::ValidatePointer().
|
inlineprotectedinherited |
Definition at line 279 of file ticpp.h.
References m_impRC, and TiCppRC::m_tiRC.
Referenced by ticpp::Attribute::SetTiXmlPointer(), and ticpp::NodeImp< T >::SetTiXmlPointer().
|
inline |
Convenience function to set the text of an element.
Creates a Text node and inserts it as the first child. Uses ToString to convert the parameter to a string.
| value | The text to set. |
Definition at line 1724 of file ticpp.h.
References ticpp::NodeImp< TiXmlElement >::m_tiXmlPointer, ticpp::NodeImp< TiXmlElement >::ToString(), and ticpp::NodeImp< TiXmlElement >::ValidatePointer().
Referenced by Element().
|
inlineprotectedinherited |
|
inlineinherited |
Set the value of this node.
Uses Base::ToString to convert value to a std::string, then calls TiXmlNode::SetValue.
| value | The value to set |
Definition at line 490 of file ticpp.h.
References GetTiXmlPointer(), TiXmlNode::SetValue(), and ticpp::Base::ToString().
|
inlineinherited |
Pointer conversion ( NOT OBJECT CONVERSION ) - replaces TiXmlNode::ToElement, TiXmlNode::ToDocument, TiXmlNode::ToComment, etc.
| Exception | When the target is not an object of class T |
Definition at line 961 of file ticpp.h.
References TICPPTHROW.
|
inherited |
Pointer conversion - replaces TiXmlNode::ToComment.
Definition at line 583 of file ticpp.cpp.
References GetTiXmlPointer(), TiCppRC::m_spawnedWrappers, TICPPTHROW, TiXmlNode::ToComment(), and Value().
|
inherited |
Pointer conversion - replaces TiXmlNode::ToDeclaration.
| Exception | When this node is not a Declaration. |
Definition at line 609 of file ticpp.cpp.
References GetTiXmlPointer(), TICPPTHROW, TiXmlNode::ToDeclaration(), and Value().
|
inherited |
Pointer conversion - replaces TiXmlNode::ToDocument.
Definition at line 557 of file ticpp.cpp.
References GetTiXmlPointer(), TiCppRC::m_spawnedWrappers, TICPPTHROW, TiXmlNode::ToDocument(), and Value().
|
inherited |
Pointer conversion - replaces TiXmlNode::ToElement.
Definition at line 570 of file ticpp.cpp.
References GetTiXmlPointer(), TiCppRC::m_spawnedWrappers, TICPPTHROW, TiXmlNode::ToElement(), and Value().
|
inlineinherited |
|
inlineinherited |
Converts any class with a proper overload of the << opertor to a std::string.
| value | The value to be converted |
| Exception | When value cannot be converted to a std::string |
Definition at line 169 of file ticpp.h.
References TICPPTHROW.
Referenced by ticpp::Attribute::SetName(), ticpp::Attribute::SetValue(), and ticpp::Node::SetValue().
|
inherited |
Pointer conversion - replaces TiXmlNode::ToStylesheetReference.
| Exception | When this node is not a StylesheetReference. |
Definition at line 622 of file ticpp.cpp.
References GetTiXmlPointer(), TICPPTHROW, TiXmlNode::ToStylesheetReference(), and Value().
|
inherited |
Pointer conversion - replaces TiXmlNode::ToText.
Definition at line 596 of file ticpp.cpp.
References GetTiXmlPointer(), TICPPTHROW, TiXmlNode::ToText(), and Value().
|
inherited |
Query the type (as TiXmlNode::NodeType ) of this node.
Definition at line 536 of file ticpp.cpp.
References GetTiXmlPointer(), and TiXmlNode::Type().
Referenced by InsertAfterChild(), InsertBeforeChild(), InsertEndChild(), LinkEndChild(), and ReplaceChild().
|
inlineprotectedinherited |
Definition at line 281 of file ticpp.h.
References m_impRC, and TICPPTHROW.
Referenced by ticpp::Attribute::GetBasePointer(), ticpp::Attribute::GetName(), ticpp::NodeImp< T >::GetTiXmlPointer(), ticpp::Attribute::GetValue(), ticpp::Attribute::Name(), ticpp::Attribute::Next(), ticpp::Attribute::Previous(), ticpp::Attribute::Print(), ticpp::Attribute::SetName(), ticpp::Attribute::SetValue(), and ticpp::Attribute::Value().
|
inherited |
Get the value of this node.
Simple wrapper for TiXmlNode::ValueStr.
Definition at line 230 of file ticpp.cpp.
References GetTiXmlPointer(), and TiXmlNode::ValueStr().
Referenced by ticpp::NodeImp< TiXmlComment >::FirstChild(), FirstChildElement(), NextSibling(), PreviousSibling(), RemoveChild(), ToComment(), ToDeclaration(), ToDocument(), ToElement(), ToStylesheetReference(), and ToText().
|
mutableprotectedinherited |
Holds status of internal TiXmlPointer - use this to determine if object has been deleted already.
Definition at line 267 of file ticpp.h.
Referenced by ticpp::Attribute::Attribute(), ticpp::Attribute::Attribute(), ticpp::Attribute::Attribute(), ticpp::Attribute::Attribute(), ticpp::NodeImp< T >::NodeImp(), ticpp::NodeImp< T >::NodeImp(), ticpp::Attribute::~Attribute(), ticpp::NodeImp< T >::~NodeImp(), ticpp::Node::InsertAfterChild(), ticpp::Node::InsertBeforeChild(), ticpp::Node::LinkEndChild(), ticpp::Attribute::operator=(), ticpp::NodeImp< T >::operator=(), ticpp::Node::ReplaceChild(), SetImpRC(), and ValidatePointer().
|
protectedinherited |
Internal pointer to the TiXml Class which is being wrapped.
Definition at line 1262 of file ticpp.h.
Referenced by ticpp::Element::FirstAttribute(), ticpp::Element::GetAttributeImp(), ticpp::Element::GetTextImp(), ticpp::Element::HasAttribute(), ticpp::Element::LastAttribute(), ticpp::Element::RemoveAttribute(), ticpp::Element::SetAttribute(), and ticpp::Element::SetText().