00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00044 #include "../tinyxml/tinyxml.h"
00045
00046 #include "attribute.h"
00047
00048 using namespace libsvx;
00049
00052 Attribute::Attribute(const std::string & AttributeString, const std::string the_name):
00053 m_AttrName(the_name)
00054 {
00055 m_String = AttributeString;
00056 }
00057
00061 Attribute::Attribute(const Attribute & a_attribute)
00062 {
00063 m_String = a_attribute.m_String;
00064 m_AttrName = a_attribute.m_AttrName;
00065 }
00066
00070 Attribute::~Attribute()
00071 {
00072 }
00073
00077 const std::string & Attribute::String() const
00078 {
00079 return m_String;
00080 }
00081
00085 const bool Attribute::Bool() const
00086 {
00087 return !(m_String.compare("0") == 0 || m_String.compare("false") == 0);
00088 }
00089
00090 void Attribute::XmlElement(TiXmlElement & the_element_to_fill)
00091 {
00092 the_element_to_fill.SetAttribute(m_AttrName, String());
00093 }
00094
00095 bool Attribute::operator!=(const Attribute & the_object_to_compare) const
00096 {
00097 bool result = false;
00098
00099 result = result || (m_AttrName.compare(the_object_to_compare.m_AttrName) != 0);
00100 result = result || (m_String.compare(the_object_to_compare.m_String) != 0);
00101
00102 return result;
00103 }
00104