diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index 5c319db..b65bada 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -3564,10 +3564,229 @@ namespace ZNsMain }/* namespace ZNsConst*/ + + + template TStringData& ZftConvertXhtml(TStringData& ARRoCString) + { + /* 데이타를 그대로 클라이언트에 전송하면, HTML 태그와 + 혼동될 수 있는데, 이를 방지하기 위해 적절히 인코딩한다. + */ + return ARRoCString. + Replace("&" ,"&" ). Replace("<" ,"<" ). + Replace(">" ,">" ). Replace(" " ," "). + Replace("\n","
" ); + }/* + template TStringData& ConvertXhtml(TStringData& ARRoCString) */ + + + template TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData) + { + return ARRoCStringData. + Replace("&" , "&" ).Replace("\r", " " ). + Replace("\n", " " ).Replace("\t", " " ). + Replace("\"", """).Replace(">" , ">" ).Replace("<", "<"); + }/* + template TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData)*/ + + template TStringData& ZftMakeXmlAttDec(TStringData& ARRoCStringData) + { + return ARRoCStringData. + Replace(" " ,"\r" ). Replace(" " ,"\n"). + Replace(" " ,"\t" ). Replace(""","\""). + Replace(">" ,">" ). Replace("<" ,"<" ). Replace("&" ,"&" ); + }/* + template TStringData& ZftMakeXmlAttDec(TStringData& ARRoCStringData)*/ + + + + template + TString& ZftMakeStr(TString& ARR_SaveCStr, TObject AO_Object) + { return ARR_SaveCStr; } + //////////////////////////////////////////// + + + template<> string& ZftMakeStr(string& ARR_SaveCStr, const string& AR_DataCStr) + { + ARR_SaveCStr.append(AR_DataCStr); return ARR_SaveCStr; + }/* + template<> string& ZftMakeStr(string& ARR_SaveCStr, const string& AR_DataCStr)*/ + + template<> string& ZftMakeStr(string& ARR_SaveCStr, long AL_Long) + { + const int CI_BuffSize = 31 ; + char VCA_BuffParam[CI_BuffSize] ; + + int VI_ResultSize = + ::sprintf(VCA_BuffParam, "%ld", AL_Long); + + ARR_SaveCStr.append + (VCA_BuffParam, VI_ResultSize); + + return ARR_SaveCStr; + }/* + template<> string& ZftMakeStr(string& ARR_SaveCStr, long AL_Long)*/ + + template<> string& ZftMakeStr(string& ARR_SaveCStr, double AD_Double) + { + const int CI_BuffSize=51 ; + char VCA_BuffParam[CI_BuffSize]; + + int VI_ResultSize = ::sprintf + ( + VCA_BuffParam, "%f", AD_Double + ); + ///////////////////////////// + + ARR_SaveCStr.append + (VCA_BuffParam, VI_ResultSize); + + return ARR_SaveCStr; + }/* + template<> string& ZftMakeStr(string& ARR_SaveCStr, double AD_Double)*/ + + template<> string& ZftMakeStr(string& ARR_SaveCStr, bool AB_Bool) + { + if (AB_Bool) + ARR_SaveCStr.append("true" ); + else ARR_SaveCStr.append("false"); + + return ARR_SaveCStr; + }/* + template<> string& ZftMakeStr(string& ARR_SaveCStr, bool AB_Bool)*/ + + + + namespace ZNsView + { + + class ZCViewLogData + { + public: + + virtual void Log(const char* APC_LogData, ZTypLength AI_Length) + { + cout<' ){cout<<">" ; continue;} + if(APC_LogData[i]=='<' ){cout<<"<" ; continue;} + + cout< - TString& ZftMakeStr(TString& ARR_SaveCStr, TObject AO_Object) - { return ARR_SaveCStr; } - //////////////////////////////////////////// - - - template<> string& ZftMakeStr(string& ARR_SaveCStr, const string& AR_DataCStr) - { - ARR_SaveCStr.append(AR_DataCStr); return ARR_SaveCStr; - }/* - template<> string& ZftMakeStr(string& ARR_SaveCStr, const string& AR_DataCStr)*/ - - template<> string& ZftMakeStr(string& ARR_SaveCStr, long AL_Long) - { - const int CI_BuffSize = 31 ; - char VCA_BuffParam[CI_BuffSize] ; - - int VI_ResultSize = - ::sprintf(VCA_BuffParam, "%ld", AL_Long); - - ARR_SaveCStr.append - (VCA_BuffParam, VI_ResultSize); - - return ARR_SaveCStr; - }/* - template<> string& ZftMakeStr(string& ARR_SaveCStr, long AL_Long)*/ - - template<> string& ZftMakeStr(string& ARR_SaveCStr, double AD_Double) - { - const int CI_BuffSize=51 ; - char VCA_BuffParam[CI_BuffSize]; - - int VI_ResultSize = ::sprintf - ( - VCA_BuffParam, "%f", AD_Double - ); - ///////////////////////////// - - ARR_SaveCStr.append - (VCA_BuffParam, VI_ResultSize); - - return ARR_SaveCStr; - }/* - template<> string& ZftMakeStr(string& ARR_SaveCStr, double AD_Double)*/ - - template<> string& ZftMakeStr(string& ARR_SaveCStr, bool AB_Bool) - { - if (AB_Bool) - ARR_SaveCStr.append("true" ); - else ARR_SaveCStr.append("false"); - - return ARR_SaveCStr; - }/* - template<> string& ZftMakeStr(string& ARR_SaveCStr, bool AB_Bool)*/ - - - - template TStringData& ZftConvertXhtml(TStringData& ARRoCString) - { - /* 데이타를 그대로 클라이언트에 전송하면, HTML 태그와 - 혼동될 수 있는데, 이를 방지하기 위해 적절히 인코딩한다. - */ - return ARRoCString. - Replace("&" ,"&" ). Replace("<" ,"<" ). - Replace(">" ,">" ). Replace(" " ," "). - Replace("\n","
" ); - }/* - template TStringData& ConvertXhtml(TStringData& ARRoCString) */ - - - template TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData) - { - return ARRoCStringData. - Replace("&" , "&" ).Replace("\r", " " ). - Replace("\n", " " ).Replace("\t", " " ). - Replace("\"", """).Replace(">" , ">" ).Replace("<", "<"); - }/* - template TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData)*/ - - template TStringData& ZftMakeXmlAttDec(TStringData& ARRoCStringData) - { - return ARRoCStringData. - Replace(" " ,"\r" ). Replace(" " ,"\n"). - Replace(" " ,"\t" ). Replace(""","\""). - Replace(">" ,">" ). Replace("<" ,"<" ). Replace("&" ,"&" ); - }/* - template TStringData& ZftMakeXmlAttDec(TStringData& ARRoCStringData)*/ - -}/* -namespace ZNsMain*/ - - /*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////