28 |
28 |
public:
|
29 |
29 |
CXMLAutoPtr(const char *value = NULL) : _Value(value) {}
|
30 |
30 |
CXMLAutoPtr(const unsigned char *value) : _Value((const char *) value) {}
|
31 |
|
~CXMLAutoPtr();
|
|
31 |
~CXMLAutoPtr() { destroy(); }
|
32 |
32 |
operator const char *() const { return _Value; }
|
33 |
33 |
operator bool() const { return _Value != NULL; }
|
34 |
34 |
operator std::string() const { return std::string(_Value); }
|
... | ... | |
36 |
36 |
operator const unsigned char *() const { return (const unsigned char *) _Value; }
|
37 |
37 |
const char operator * () const { nlassert(_Value); return *_Value; }
|
38 |
38 |
/// NB : This remove previous owned pointer with xmlFree
|
39 |
|
CXMLAutoPtr &operator = (const char *other);
|
|
39 |
CXMLAutoPtr &operator = (const char *other)
|
|
40 |
{
|
|
41 |
if (other == _Value) return *this;
|
|
42 |
destroy();
|
|
43 |
_Value = other;
|
|
44 |
return *this;
|
|
45 |
}
|
40 |
46 |
CXMLAutoPtr &operator = (const unsigned char *other)
|
41 |
47 |
{
|
42 |
48 |
*this = (const char *) other;
|