00001 #ifndef ots_ConvertFromXML_h 00002 #define ots_ConvertFromXML_h 00003 00004 #include <xercesc/util/XMLChar.hpp> 00005 #include <string> 00006 00007 namespace ots 00008 { 00009 00010 class ConvertFromXML 00011 { 00012 public : 00013 ConvertFromXML(const XMLCh* const toTranscode); 00014 ~ConvertFromXML(); 00015 00016 const char* toConstChar(void) const; 00017 char* toChar (void) const; 00018 std::string toString (void) const; 00019 00020 private : 00021 char* xmlTranscoded_; 00022 }; 00023 00024 #define XML_TO_CONST_CHAR(xml) ConvertFromXML(xml).toConstChar() 00025 #define XML_TO_CHAR(xml) ConvertFromXML(xml).toChar() 00026 #define XML_TO_STRING(xml) ConvertFromXML(xml).toString() 00027 00028 } 00029 00030 #endif