#ifndef INPUTXSLT_SRC_SUPPORT_XERCES_STRING_GUARD_H_ #define INPUTXSLT_SRC_SUPPORT_XERCES_STRING_GUARD_H_ #include #include namespace InputXSLT { template class XercesStringGuard { public: XercesStringGuard(const Type* src): string_(src) { } XercesStringGuard( const std::basic_string< typename std::remove_pointer::type >& src ): string_(xercesc::XMLString::transcode(src.data())) { } ~XercesStringGuard() { xercesc::XMLString::release( const_cast(&this->string_) ); } const Type* operator*() const { return this->string_; } private: const Type* const string_; }; } #endif // INPUTXSLT_SRC_SUPPORT_XERCES_STRING_GUARD_H_