00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef MXML_ATTRIBUTE_H
00012 #define MXML_ATTRIBUTE_H
00013
00014 #include <string>
00015 #include <iostream>
00016 #include <mxml_element.h>
00017
00018 namespace MXML {
00019
00025 class Attribute: public Element
00026 {
00027 private:
00029 std::string m_name;
00031 std::string m_value;
00032
00033 public:
00044 Attribute( std::istream &in, int style=0, int line=1, int pos=0 );
00045
00046
00047
00048
00049
00050
00051
00052 Attribute( const std::string &name, const std::string &value ): Element()
00053 {
00054 m_name = name;
00055 m_value = value;
00056 }
00057
00058
00059 Attribute( Attribute &src): Element( src )
00060 {
00061 m_name= src.m_name;
00062 m_value = src.m_value;
00063 };
00064
00066 const std::string name() const { return m_name; }
00071 const std::string value() const { return m_value; }
00072
00076 void name( const std::string &new_name ) { m_name = new_name; }
00077
00081 void value( const std::string &new_value ) { m_value = new_value; }
00082
00091 virtual void write( std::ostream &out, const int style ) const;
00092 };
00093
00094 }
00095
00096 #endif