diff --git a/exml/EXmlAttribute.cpp b/exml/EXmlAttribute.cpp index a306dc5..6da20bc 100644 --- a/exml/EXmlAttribute.cpp +++ b/exml/EXmlAttribute.cpp @@ -95,7 +95,7 @@ bool exml::EXmlAttribute::Parse(const etk::UString& _data, int32_t& _pos, bool _ return true; } -bool exml::EXmlAttribute::Generate(etk::UString& _data, int32_t _indent) +bool exml::EXmlAttribute::Generate(etk::UString& _data, int32_t _indent) const { _data += " "; _data += m_name; diff --git a/exml/EXmlAttribute.h b/exml/EXmlAttribute.h index 3446f64..1c97f35 100644 --- a/exml/EXmlAttribute.h +++ b/exml/EXmlAttribute.h @@ -20,14 +20,16 @@ namespace exml EXmlAttribute(void) { }; EXmlAttribute(const etk::UString& _name, const etk::UString& _value); virtual ~EXmlAttribute(void) { }; - virtual nodeType_te GetType(void) { return exml::typeAttribute; }; + virtual nodeType_te GetType(void) const { return exml::typeAttribute; }; virtual bool Parse(const etk::UString& _data, int32_t& _pos, bool _caseSensitive, ivec2& _filePos); - virtual bool Generate(etk::UString& _data, int32_t _indent); + virtual bool Generate(etk::UString& _data, int32_t _indent) const; protected: etk::UString m_name; public: virtual void SetName(etk::UString _name) { m_name = _name; }; - virtual const etk::UString& GetName(void) { return m_name; }; + virtual const etk::UString& GetName(void) const { return m_name; }; + virtual operator exml::EXmlAttribute* () { return this; }; + virtual operator const exml::EXmlAttribute* () const { return this; }; }; }; diff --git a/exml/EXmlComment.cpp b/exml/EXmlComment.cpp index bd37c22..6fb6445 100644 --- a/exml/EXmlComment.cpp +++ b/exml/EXmlComment.cpp @@ -35,7 +35,7 @@ bool exml::EXmlComment::Parse(const etk::UString& _data, int32_t& _pos, bool _ca return false; } -bool exml::EXmlComment::Generate(etk::UString& _data, int32_t _indent) +bool exml::EXmlComment::Generate(etk::UString& _data, int32_t _indent) const { AddIndent(_data, _indent); _data += "