Go to the documentation of this file.00001 #ifndef XERCES_STRINGS_H
00002 #define XERCES_STRINGS_H
00003
00004 #include <string>
00005 #include <boost/scoped_array.hpp>
00006 #include <xercesc/util/XMLString.hpp>
00007 #include <iostream>
00008
00009
00025 namespace xuti {
00026
00028 typedef std::basic_string<XMLCh> XercesString;
00029
00030
00031 inline XercesString fromNative(const char* str){
00032 boost::scoped_array<XMLCh> ptr(xercesc::XMLString::transcode(str));
00033 return XercesString(ptr.get( ));
00034 }
00035
00036
00037 inline XercesString fromNative(const std::string& str){
00038 return fromNative(str.c_str( ));
00039 }
00040
00041
00042 inline std::string toNative(const XMLCh* str){
00043 boost::scoped_array<char> ptr(xercesc::XMLString::transcode(str));
00044 return std::string(ptr.get( ));
00045 }
00046
00047
00048 inline std::string toNative(const XercesString& str){
00049 return toNative(str.c_str( ));
00050 }
00051
00052
00053 }
00054
00055 #endif // #ifndef XERCES_STRINGS_H