![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Wrapper around TiXmlAttribute. More...
#include <ticpp.h>
Public Member Functions | |
| Attribute () | |
| Construct an empty attribute. | |
| Attribute (const std::string &name, const std::string &value) | |
| Construct an attribute with name and value. | |
| Attribute (TiXmlAttribute *attribute) | |
| template<class T> | |
| void | GetValue (T *value) const |
| Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::ValueStr from a std::string, and puts it in the passed pointer. | |
| std::string | Value () const |
| Get the value of this attribute. | |
| template<class T> | |
| void | SetValue (const T &value) |
| Set the value of this node. | |
| template<class T> | |
| void | GetName (T *name) const |
| Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::Name from a std::string, and puts it in the passed pointer. | |
| std::string | Name () const |
| Get the value of this attribute. | |
| template<class T> | |
| void | SetName (const T &name) |
| Set the value of this attribute. | |
| void | operator= (const Attribute ©) |
| Attribute (const Attribute ©) | |
| ~Attribute () | |
| Attribute * | Next (bool throwIfNoAttribute=true) const |
| Get the next sibling attribute in the DOM. | |
| Attribute * | Previous (bool throwIfNoAttribute=true) const |
| Get the previous sibling attribute in the DOM. | |
| void | IterateNext (const std::string &, Attribute **next) const |
| void | IteratePrevious (const std::string &, Attribute **previous) const |
| virtual void | Print (FILE *file, int depth) const |
| All TinyXml classes can print themselves to a filestream. | |
| 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 | |
| void | SetImpRC (TiXmlBase *nodeBase) |
| void | ValidatePointer () const |
Protected Attributes | |
| TiCppRCImp * | m_impRC |
| Holds status of internal TiXmlPointer - use this to determine if object has been deleted already. | |
Private Member Functions | |
| TiXmlBase * | GetBasePointer () const |
| void | SetTiXmlPointer (TiXmlAttribute *newPointer) |
Private Attributes | |
| TiXmlAttribute * | m_tiXmlPointer |
Wrapper around TiXmlAttribute.
| Attribute::Attribute | ( | ) |
Construct an empty attribute.
Definition at line 75 of file ticpp.cpp.
References ticpp::Base::m_impRC, and SetTiXmlPointer().
Referenced by Attribute(), IterateNext(), IteratePrevious(), Next(), operator=(), and Previous().
| Attribute::Attribute | ( | const std::string & | name, |
| const std::string & | value ) |
Construct an attribute with name and value.
| name | The name of the attribute |
| value | The value of the attribute |
Definition at line 85 of file ticpp.cpp.
References ticpp::Base::m_impRC, and SetTiXmlPointer().
| Attribute::Attribute | ( | TiXmlAttribute * | attribute | ) |
Definition at line 80 of file ticpp.cpp.
References ticpp::Base::m_impRC, and SetTiXmlPointer().
| Attribute::Attribute | ( | const Attribute & | copy | ) |
Definition at line 101 of file ticpp.cpp.
References Attribute(), ticpp::Base::m_impRC, m_tiXmlPointer, and SetTiXmlPointer().
| Attribute::~Attribute | ( | ) |
Definition at line 113 of file ticpp.cpp.
References ticpp::Base::m_impRC.
|
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().
|
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().
|
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().
|
inlineprivatevirtual |
Implements ticpp::Base.
Definition at line 300 of file ticpp.h.
References m_tiXmlPointer, and ticpp::Base::ValidatePointer().
|
inline |
Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::Name from a std::string, and puts it in the passed pointer.
| name | [OUT] A pointer to fill with the name |
Definition at line 370 of file ticpp.h.
References ticpp::Base::FromString(), m_tiXmlPointer, and ticpp::Base::ValidatePointer().
|
inline |
Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::ValueStr from a std::string, and puts it in the passed pointer.
| value | [OUT] A pointer to fill with the value |
Definition at line 336 of file ticpp.h.
References ticpp::Base::FromString(), m_tiXmlPointer, and ticpp::Base::ValidatePointer().
| void Attribute::IterateNext | ( | const std::string & | , |
| Attribute ** | next ) const |
Definition at line 161 of file ticpp.cpp.
References Attribute(), and Next().
| void Attribute::IteratePrevious | ( | const std::string & | , |
| Attribute ** | previous ) const |
Definition at line 165 of file ticpp.cpp.
References Attribute(), and Previous().
| std::string Attribute::Name | ( | ) | const |
Get the value of this attribute.
Simple wrapper for TiXmlAttribute::Name.
Definition at line 120 of file ticpp.cpp.
References m_tiXmlPointer, and ticpp::Base::ValidatePointer().
Get the next sibling attribute in the DOM.
Definition at line 125 of file ticpp.cpp.
References Attribute(), TiCppRC::m_spawnedWrappers, m_tiXmlPointer, TICPPTHROW, and ticpp::Base::ValidatePointer().
Referenced by ticpp::Element::IterateFirst(), and IterateNext().
Compare internal TiXml pointers to determine is both are wrappers around the same node.
Definition at line 231 of file ticpp.h.
References GetBasePointer().
| void Attribute::operator= | ( | const Attribute & | copy | ) |
Definition at line 90 of file ticpp.cpp.
References Attribute(), ticpp::Base::m_impRC, m_tiXmlPointer, and SetTiXmlPointer().
Compare internal TiXml pointers to determine is both are wrappers around the same node.
Definition at line 222 of file ticpp.h.
References GetBasePointer().
Get the previous sibling attribute in the DOM.
Definition at line 143 of file ticpp.cpp.
References Attribute(), TiCppRC::m_spawnedWrappers, m_tiXmlPointer, TICPPTHROW, and ticpp::Base::ValidatePointer().
Referenced by IteratePrevious().
|
virtual |
All TinyXml classes can print themselves to a filestream.
Definition at line 169 of file ticpp.cpp.
References m_tiXmlPointer, and ticpp::Base::ValidatePointer().
|
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().
|
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 |
Set the value of this attribute.
Uses Base::ToString to convert name to a std::string, then calls TiXmlAttribute::SetName.
| name | The name to set |
Definition at line 391 of file ticpp.h.
References m_tiXmlPointer, ticpp::Base::ToString(), and ticpp::Base::ValidatePointer().
|
private |
Definition at line 174 of file ticpp.cpp.
References m_tiXmlPointer, and ticpp::Base::SetImpRC().
Referenced by Attribute(), Attribute(), Attribute(), Attribute(), and operator=().
|
inline |
Set the value of this node.
Uses Base::ToString to convert value to a std::string, then calls TiXmlAttribute::SetValue.
| value | The value to set |
Definition at line 357 of file ticpp.h.
References m_tiXmlPointer, ticpp::Base::ToString(), and ticpp::Base::ValidatePointer().
|
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().
|
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().
| std::string Attribute::Value | ( | ) | const |
Get the value of this attribute.
Simple wrapper for TiXmlAttribute::ValueStr.
Definition at line 115 of file ticpp.cpp.
References m_tiXmlPointer, and ticpp::Base::ValidatePointer().
|
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().
|
private |
Definition at line 299 of file ticpp.h.
Referenced by Attribute(), GetBasePointer(), GetName(), GetValue(), Name(), Next(), operator=(), Previous(), Print(), SetName(), SetTiXmlPointer(), SetValue(), and Value().