diff options
Diffstat (limited to 'src/support/xerces_string_guard.cc')
-rw-r--r-- | src/support/xerces_string_guard.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/support/xerces_string_guard.cc b/src/support/xerces_string_guard.cc new file mode 100644 index 0000000..14ad29b --- /dev/null +++ b/src/support/xerces_string_guard.cc @@ -0,0 +1,18 @@ +#include "xerces_string_guard.h" + +namespace InputXSLT { + +XercesStringGuard::XercesStringGuard(const std::string& src): + string_(xercesc::XMLString::transcode(src.data())) { } + +XercesStringGuard::~XercesStringGuard() { + xercesc::XMLString::release( + const_cast<XMLCh**>(&this->string_) + ); +} + +XMLCh* XercesStringGuard::operator*() { + return this->string_; +} + +} |