commit 2025-08-28 20:23 add ZftMakeStr() in ZCppMain/ZMainHead.H and ZtCStringEx.H

This commit is contained in:
2025-08-28 20:23:49 +09:00
parent 6cbb30f285
commit 9a8e5b59fd
2 changed files with 95 additions and 0 deletions

View File

@ -3681,6 +3681,63 @@ namespace ZNsCPP */
namespace ZNsMain
{
template<typename TString, typename TObject>
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<typename TStringData> TStringData& ZftConvertXhtml(TStringData& ARRoCString)
{
/* 데이타를 그대로 클라이언트에 전송하면, HTML 태그와

View File

@ -8270,6 +8270,44 @@ namespace ZNsMain
) */
#define _ZCSTRINGBASE_ ZtCStringBase<TTypCh, TAlloc, TAllocSize, TTypeString>
#define _ZCSTRINGBASE_ARG_ \
template< typename TTypCh , typename TAlloc , \
typename TAllocSize , typename TTypeString \
>
_ZCSTRINGBASE_ARG_ _ZCSTRINGBASE_& ZftMakeStr
( _ZCSTRINGBASE_& ARR_SaveCStr, const _ZCSTRINGBASE_& AR_DataCStr)
{ return ARR_SaveCStr(AR_DataCStr); }
_ZCSTRINGBASE_ARG_ _ZCSTRINGBASE_& ZftMakeStr
( _ZCSTRINGBASE_& ARR_SaveCStr, int AI_IntI )
{ return ARR_SaveCStr(AI_IntI ); }
_ZCSTRINGBASE_ARG_ _ZCSTRINGBASE_& ZftMakeStr
( _ZCSTRINGBASE_& ARR_SaveCStr, long AL_Long )
{ return ARR_SaveCStr(AL_Long ); }
_ZCSTRINGBASE_ARG_ _ZCSTRINGBASE_& ZftMakeStr
( _ZCSTRINGBASE_& ARR_SaveCStr, double AD_Double )
{ return ARR_SaveCStr(AD_Double ); }
_ZCSTRINGBASE_ARG_ _ZCSTRINGBASE_& ZftMakeStr
( _ZCSTRINGBASE_& ARR_SaveCStr, bool AB_Bool )
{
if (AB_Bool)
ARR_SaveCStr.append("true" );
else ARR_SaveCStr.append("false");
return ARR_SaveCStr;
}/*
_ZCSTRINGBASE_& ZftMakeStr( _ZCSTRINGBASE_& ARR_SaveCStr, bool AB_Bool)*/
#undef _ZCSTRINGBASE_
#undef _ZCSTRINGBASE_ARG_
namespace ZNsFunc
{