X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=include%2Fifmsxmldocument.h;h=ae555a1fad52ec06663cab8972462a21876028d0;hb=0236076defe60bcd4b3a25c23efa53c21993a48e;hp=24484ecf080f5cc7369e4b5057785670fae3b655;hpb=d8f51eac91f86a1e00a05a5058a8fa9eb8732464;p=fms.git diff --git a/include/ifmsxmldocument.h b/include/ifmsxmldocument.h index 24484ec..ae555a1 100644 --- a/include/ifmsxmldocument.h +++ b/include/ifmsxmldocument.h @@ -1,9 +1,15 @@ #ifndef _ifmsxmldocument_ #define _ifmsxmldocument_ +#include "stringfunctions.h" + #include #include +#ifdef XMEM + #include +#endif + /** \brief Interface for objects that represent an XML document */ @@ -60,6 +66,13 @@ protected: return el; } + virtual TiXmlElement *XMLCreateTextElement(const std::string &name, const long data) + { + std::string datastr; + StringFunctions::Convert(data,datastr); + return XMLCreateTextElement(name,datastr); + } + virtual const bool XMLGetBooleanElement(TiXmlElement *parent, const std::string &name) { TiXmlHandle hnd(parent); @@ -77,6 +90,17 @@ protected: } return false; } + + const std::string SanitizeSingleString(const std::string &text) + { + std::string returntext=text; + // remove bogus chars from text string + for(char i=1; i<32; i++) + { + returntext=StringFunctions::Replace(returntext,std::string(1,i),""); + } + return returntext; + } };