39 #ifndef OME_COMMON_XML_STRING_H
40 #define OME_COMMON_XML_STRING_H
46 #include <xercesc/util/XMLString.hpp>
87 narrow(xercesc::XMLString::transcode(str)),
88 wide(xercesc::XMLString::replicate(str))
90 assert(this->
wide != 0);
103 narrow(xercesc::XMLString::replicate(str)),
104 wide(xercesc::XMLString::transcode(str))
106 assert(this->
narrow != 0);
107 assert(this->
wide != 0);
119 narrow(xercesc::XMLString::replicate(str.c_str())),
120 wide(xercesc::XMLString::transcode(str.c_str()))
122 assert(this->
narrow != 0);
123 assert(this->
wide != 0);
133 xercesc::XMLString::release(&
narrow);
135 xercesc::XMLString::release(&
wide);
144 operator const XMLCh *()
const
146 assert(this->
wide != 0);
157 operator ::std::string()
const
159 assert(this->
narrow != 0);
173 assert(this->
narrow != 0);
187 return this->
narrow != 0 && strcmp(this->
narrow, rhs) == 0;
199 return this->
narrow != 0 && strcmp(this->
narrow, rhs.c_str()) == 0;
224 return !(*
this == rhs);
236 return !(*
this == rhs);
248 return !(*
this == rhs);
265 inline ::std::ostream&
269 return os << static_cast<std::string>(str);
276 #endif // OME_COMMON_XML_STRING_H
XMLCh * wide
The XMLCh * string representation.
Definition: String.h:255
String(const char *str)
Construct a String from a NUL-terminated string.
Definition: String.h:102
bool operator==(const char *rhs)
Compare a String for equality with a C string.
Definition: String.h:185
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
inline::std::string str() const
Get the String content as a std::string.
Definition: String.h:171
String(std::string const &str)
Construct a String from a std::string.
Definition: String.h:118
bool operator!=(const char *rhs)
Compare a String for inequality with a C string.
Definition: String.h:222
String(const XMLCh *str)
Construct a String from an XMLCh * string.
Definition: String.h:86
Xerces string wrapper.
Definition: String.h:74
char * narrow
The char * string representation.
Definition: String.h:253
~String()
Destructor.
Definition: String.h:130
inline::std::ostream & operator<<(::std::ostream &os, const String &str)
Output String to output stream.
Definition: String.h:266
Xerces-C modern C++ wrapper.
Definition: Base.h:53