00001
00002
00003
00004
00005 #include "ace/ACE.h"
00006 #include "ace/OS_NS_string.h"
00007
00008 ACEXML_INLINE
00009 ACEXML_Attribute::ACEXML_Attribute (void)
00010 : uri_ (0),
00011 localName_ (0),
00012 qName_ (0),
00013 type_ (0),
00014 value_ (0)
00015 {
00016 }
00017
00018 ACEXML_INLINE
00019 ACEXML_Attribute::ACEXML_Attribute (const ACEXML_Attribute &attr)
00020 : uri_ (ACE::strnew (attr.uri_)),
00021 localName_ (ACE::strnew (attr.localName_)),
00022 qName_ (ACE::strnew (attr.qName_)),
00023 type_ (ACE::strnew (attr.type_)),
00024 value_ (ACE::strnew (attr.value_))
00025 {
00026 }
00027
00028 ACEXML_INLINE
00029 ACEXML_Attribute::ACEXML_Attribute (const ACEXML_Char *uri,
00030 const ACEXML_Char *localName,
00031 const ACEXML_Char *qName,
00032 const ACEXML_Char *type,
00033 const ACEXML_Char *value)
00034 : uri_ (ACE::strnew (uri)),
00035 localName_ (ACE::strnew (localName)),
00036 qName_ (ACE::strnew (qName)),
00037 type_ (ACE::strnew (type)),
00038 value_ (ACE::strnew (value))
00039 {
00040 }
00041
00042 ACEXML_INLINE
00043 ACEXML_Attribute::~ACEXML_Attribute (void)
00044 {
00045 delete[] this->uri_;
00046 delete[] this->localName_;
00047 delete[] this->qName_;
00048 delete[] this->type_;
00049 delete[] this->value_;
00050 }
00051
00052 ACEXML_INLINE const ACEXML_Char *
00053 ACEXML_Attribute::uri (void) const
00054 {
00055 return this->uri_;
00056 }
00057
00058 ACEXML_INLINE void
00059 ACEXML_Attribute::uri (const ACEXML_Char *uri)
00060 {
00061 delete[] this->uri_;
00062 this->uri_ = ACE::strnew (uri);
00063 }
00064
00065 ACEXML_INLINE const ACEXML_Char *
00066 ACEXML_Attribute::localName (void) const
00067 {
00068 return this->localName_;
00069 }
00070
00071 ACEXML_INLINE void
00072 ACEXML_Attribute::localName (const ACEXML_Char *localName)
00073 {
00074 delete[] this->localName_;
00075 this->localName_ = ACE::strnew (localName);
00076 }
00077
00078 ACEXML_INLINE const ACEXML_Char *
00079 ACEXML_Attribute::qName (void) const
00080 {
00081 return this->qName_;
00082 }
00083
00084 ACEXML_INLINE void
00085 ACEXML_Attribute::qName (const ACEXML_Char *qName)
00086 {
00087 delete[] this->qName_;
00088 this->qName_ = ACE::strnew (qName);
00089 }
00090
00091 ACEXML_INLINE const ACEXML_Char *
00092 ACEXML_Attribute::type (void) const
00093 {
00094 return this->type_;
00095 }
00096
00097 ACEXML_INLINE void
00098 ACEXML_Attribute::type (const ACEXML_Char *type)
00099 {
00100 delete[] this->type_;
00101 this->type_ = ACE::strnew (type);
00102 }
00103
00104 ACEXML_INLINE const ACEXML_Char *
00105 ACEXML_Attribute::value (void) const
00106 {
00107 return this->value_;
00108 }
00109
00110 ACEXML_INLINE void
00111 ACEXML_Attribute::value (const ACEXML_Char *value)
00112 {
00113 delete[] this->value_;
00114 this->value_ = ACE::strnew (value);
00115 }
00116
00117 ACEXML_INLINE void
00118 ACEXML_Attribute::setAttribute (const ACEXML_Char *uri,
00119 const ACEXML_Char *localName,
00120 const ACEXML_Char *qName,
00121 const ACEXML_Char *type,
00122 const ACEXML_Char *value)
00123 {
00124 this->uri (uri);
00125 this->qName (qName);
00126 this->localName (localName);
00127 this->type (type);
00128 this->value (value);
00129 }
00130
00131 ACEXML_INLINE ACEXML_Attribute &
00132 ACEXML_Attribute::operator= (const ACEXML_Attribute &rhs)
00133 {
00134 if (this != &rhs)
00135 {
00136 this->uri (rhs.uri ());
00137 this->qName (rhs.qName ());
00138 this->localName (rhs.localName ());
00139 this->type (rhs.type ());
00140 this->value (rhs.value ());
00141 }
00142 return *this;
00143 }
00144
00145 ACEXML_INLINE bool
00146 ACEXML_Attribute::operator!= (const ACEXML_Attribute &rhs) const
00147 {
00148 return (ACE_OS::strcmp (this->uri_, rhs.uri ()) == 0 &&
00149 ACE_OS::strcmp (this->localName_, rhs.localName ()) == 0 &&
00150 ACE_OS::strcmp (this->qName_, rhs .qName ()) == 0 &&
00151 ACE_OS::strcmp (this->type_, rhs.type ()) == 0 &&
00152 ACE_OS::strcmp (this->value_, rhs.value ()) == 0 ? false : true);
00153
00154 }