00001 #ifndef __CXMLAttribute__ 00002 #define __CXMLAttribute__ 00003 00004 #include "../Basics/CString.hpp" 00005 using Exponent::Basics::CString; 00006 00007 namespace Exponent 00008 { 00009 namespace IO 00010 { 00029 class CXMLAttribute : public CCountedObject 00030 { 00032 EXPONENT_CLASS_DECLARATION; 00035 // =========================================================================== 00036 00037 public: 00038 00039 // =========================================================================== 00040 00046 CXMLAttribute(const CString &name, const CString &value); 00047 00053 CXMLAttribute(const CString &name, const bool value); 00054 00060 CXMLAttribute(const CString &name, const double value); 00061 00067 CXMLAttribute(const CString &name, const float value); 00068 00074 CXMLAttribute(const CString &name, const long value); 00075 00081 CXMLAttribute(const CString &name, const int value); 00082 00086 virtual ~CXMLAttribute(); 00087 00088 // =========================================================================== 00089 00094 void setName(const CString &name); 00095 00100 void setValue(const CString &value); 00101 00106 void setValue(const bool value); 00107 00112 void setValue(const double value); 00113 00118 void setValue(const float value); 00119 00124 void setValue(const long value); 00125 00130 void setValue(const int value); 00131 00132 // =========================================================================== 00133 00138 const CString &getName() const; 00139 00144 const CString &getValue() const; 00145 00146 // =========================================================================== 00147 00152 double getValueAsDouble() const; 00153 00158 float getValueAsFloat() const; 00159 00164 long getValueAsLong() const; 00165 00170 int getValueAsInt() const; 00171 00176 bool getValueAsBool() const; 00177 00178 // =========================================================================== 00179 00180 protected: 00181 00182 // =========================================================================== 00183 00184 CString m_name; 00185 CString m_value; 00186 }; 00187 } 00188 } 00189 00190 #endif // End of CXMLAttribute.hpp