![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Wrapper around TiXmlAttribute. More...
#include <ticpp.h>
Public Member Functions | |
Attribute () | |
Construct an empty attribute. More... | |
Attribute (const std::string &name, const std::string &value) | |
Construct an attribute with name and value. More... | |
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. More... | |
std::string | Value () const |
Get the value of this attribute. More... | |
template<class T > | |
void | SetValue (const T &value) |
Set the value of this node. More... | |
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. More... | |
std::string | Name () const |
Get the value of this attribute. More... | |
template<class T > | |
void | SetName (const T &name) |
Set the value of this attribute. More... | |
void | operator= (const Attribute ©) |
Attribute (const Attribute ©) | |
~Attribute () | |
Attribute * | Next (bool throwIfNoAttribute=true) const |
Get the next sibling attribute in the DOM. More... | |
Attribute * | Previous (bool throwIfNoAttribute=true) const |
Get the previous sibling attribute in the DOM. More... | |
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. More... | |
template<class T > | |
std::string | ToString (const T &value) const |
Converts any class with a proper overload of the << opertor to a std::string. More... | |
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. More... | |
void | FromString (const std::string &temp, std::string *out) const |
Specialization for std::string. More... | |
int | Row () const |
Return the position, in the original source file, of this node or attribute. More... | |
int | Column () const |
Return the position, in the original source file, of this node or attribute. More... | |
bool | operator== (const Base &rhs) const |
Compare internal TiXml pointers to determine is both are wrappers around the same node. More... | |
bool | operator!= (const Base &rhs) const |
Compare internal TiXml pointers to determine is both are wrappers around the same node. More... | |
std::string | BuildDetailedErrorString () const |
Builds detailed error string using TiXmlDocument::Error() and others. More... | |
Protected Attributes | |
TiCppRCImp * | m_impRC |
Holds status of internal TiXmlPointer - use this to determine if object has been deleted already. More... | |
Protected Member Functions | |
void | SetImpRC (TiXmlBase *nodeBase) |
void | ValidatePointer () const |
Wrapper around TiXmlAttribute.
Attribute::Attribute | ( | ) |
Construct an empty attribute.
Definition at line 75 of file ticpp.cpp.
References TiCppRCImp::InitRef(), ticpp::Base::m_impRC, SetTiXmlPointer(), and TiXmlAttribute::TiXmlAttribute().
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 TiCppRCImp::InitRef(), and ticpp::Base::m_impRC.
Attribute::Attribute | ( | TiXmlAttribute * | attribute | ) |
Definition at line 80 of file ticpp.cpp.
References TiCppRCImp::IncRef(), ticpp::Base::m_impRC, and SetTiXmlPointer().
Referenced by ticpp::Element::FirstAttribute(), ticpp::Element::LastAttribute(), Next(), Previous(), and ticpp::Visitor::VisitEnter().
Attribute::Attribute | ( | const Attribute & | copy | ) |
Definition at line 101 of file ticpp.cpp.
References TiCppRCImp::DecRef(), TiCppRCImp::IncRef(), ticpp::Base::m_impRC, m_tiXmlPointer, and SetTiXmlPointer().
Attribute::~Attribute | ( | ) |
Definition at line 113 of file ticpp.cpp.
References TiCppRCImp::DecRef(), and 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(), and ticpp::Base::GetBasePointer().
|
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 ticpp::Base::GetBasePointer().
|
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.
|
inlineinherited |
|
inlineprivatevirtual |
Implements ticpp::Base.
Definition at line 300 of file ticpp.h.
References 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::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::ValidatePointer().
void Attribute::IterateNext | ( | const std::string & | , |
Attribute ** | next | ||
) | const |
Definition at line 161 of file ticpp.cpp.
References Next().
void Attribute::IteratePrevious | ( | const std::string & | , |
Attribute ** | previous | ||
) | const |
Definition at line 165 of file ticpp.cpp.
References 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 ticpp::Base::ValidatePointer().
Get the next sibling attribute in the DOM.
Definition at line 125 of file ticpp.cpp.
References Attribute(), m_tiXmlPointer, TiXmlAttribute::Next(), 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 ticpp::Base::GetBasePointer().
void Attribute::operator= | ( | const Attribute & | copy | ) |
Definition at line 90 of file ticpp.cpp.
References TiCppRCImp::DecRef(), TiCppRCImp::IncRef(), 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 ticpp::Base::GetBasePointer().
Get the previous sibling attribute in the DOM.
Definition at line 143 of file ticpp.cpp.
References Attribute(), m_tiXmlPointer, TiXmlAttribute::Previous(), 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, TiXmlAttribute::Print(), 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 ticpp::Base::GetBasePointer(), and TiXmlBase::Row().
|
inlineprotectedinherited |
Definition at line 279 of file ticpp.h.
References ticpp::Base::m_impRC, and TiCppRC::m_tiRC.
Referenced by ticpp::NodeImp< TiXmlDeclaration >::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 ticpp::Base::ValidatePointer().
|
private |
Definition at line 174 of file ticpp.cpp.
References m_tiXmlPointer.
Referenced by 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 ticpp::Base::ValidatePointer().
|
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.
|
inlineinherited |
|
inlineprotectedinherited |
Definition at line 281 of file ticpp.h.
References TiCppRCImp::IsNull(), and ticpp::Base::m_impRC.
Referenced by GetBasePointer(), GetName(), ticpp::NodeImp< TiXmlDeclaration >::GetTiXmlPointer(), GetValue(), Name(), Next(), Previous(), Print(), SetName(), SetValue(), and 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, ticpp::Base::ValidatePointer(), and TiXmlAttribute::ValueStr().
|
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 Attribute(), ticpp::Node::InsertAfterChild(), ticpp::Node::InsertBeforeChild(), ticpp::Node::LinkEndChild(), ticpp::NodeImp< TiXmlDeclaration >::NodeImp(), operator=(), ticpp::Node::ReplaceChild(), ticpp::Base::SetImpRC(), ticpp::Base::ValidatePointer(), ~Attribute(), and ticpp::NodeImp< TiXmlDeclaration >::~NodeImp().
|
private |
Definition at line 299 of file ticpp.h.
Referenced by Attribute(), Next(), operator=(), Previous(), Print(), SetTiXmlPointer(), and Value().