commit 2025-09-02 20:49 add operator() in ZCppMain/ZCStringStd.H

This commit is contained in:
2025-09-02 20:49:37 +09:00
parent 6a0fa2fa3b
commit 3392905ff0
2 changed files with 128 additions and 3 deletions

View File

@ -296,6 +296,125 @@ namespace ZNsMain
)
###########################################################################*/
ZCStringStd& operator()(ZCStringStd& rhs)
{
if(this==&rhs) return *this; this->append(rhs); return *this;
}/*
ZCStringStd& operator()(ZCStringStd& rhs)*/
ZCStringStd& operator()(TypeCPChar APC_Data, TypeLength AI_Length)
{
if(this->data()==APC_Data) return *this;
this->append(APC_Data, AI_Length); return *this;
}/*
ZCStringStd& operator()(TypeCPChar APC_Data, TypeLength AI_Length)*/
ZCStringStd& operator()(TypeCPChar APC_Data)
{
if(this->data()==APC_Data) return *this;
this->append(APC_Data); return *this;
}/*
ZCStringStd& operator()(TypeCPChar APC_Data)*/
ZCStringStd& operator()(TypeLength AI_Repeat, char AC_Data)
{
this->append(AI_Repeat, AC_Data); return *this;
}/*
ZCStringStd& operator()(char AC_Data, TypeLength AI_Repeat)*/
ZCStringStd& operator()(char AC_Data, TypeLength AI_Repeat=1)
{
this->append(AI_Repeat, AC_Data); return *this;
}/*
ZCStringStd& operator()(char AC_Data, TypeLength AI_Repeat=1)*/
ZCStringStd& operator()(int AI_IntParam)
{
const int CI_BuffSize=21; char VCA_BuffParam[CI_BuffSize];
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%d", AI_IntParam);
return (*this)(VCA_BuffParam, VI_ResultSize);
}/*
ZCStringStd& operator()(int AI_IntParam)*/
ZCStringStd& operator()(ZTypUInt AUI_UIntParam)
{
const int CI_BuffSize=21; char VCA_BuffParam[CI_BuffSize];
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%u", AUI_UIntParam);
return (*this)(VCA_BuffParam, VI_ResultSize);
}/*
ZCStringStd& operator()(ZTypUInt AUI_UIntParam)*/
ZCStringStd& operator()(long AL_LongParam)
{
const int CI_BuffSize=31; char VCA_BuffParam[CI_BuffSize];
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%ld", AL_LongParam);
return (*this)(VCA_BuffParam, VI_ResultSize);
}/*
ZCStringStd& operator()(long AL_LongParam)*/
ZCStringStd& operator()(ZTypULong AUL_ULongParam)
{
const int CI_BuffSize=31; char VCA_BuffParam[CI_BuffSize];
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%lu", AUL_ULongParam);
return (*this)(VCA_BuffParam, VI_ResultSize);
}/*
ZCStringStd& operator()(ZTypULong AUL_ULongParam)*/
ZCStringStd& operator()(ZTypLLong ALL_LLongParam)
{
const int CI_BuffSize=41; char VCA_BuffParam[CI_BuffSize];
#ifdef _WIN
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%I64d", ALL_LLongParam);
#else
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%lld" , ALL_LLongParam);
#endif
return (*this)(VCA_BuffParam, VI_ResultSize);
}/*
ZCStringStd& operator()(ZTypLLong ALL_LLongParam)*/
ZCStringStd& operator()(ZTypULLong AULL_LLongParam)
{
const int CI_BuffSize=41; char VCA_BuffParam[CI_BuffSize];
#ifdef _WIN
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%I64u", AULL_LLongParam);
#else
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%llu" , AULL_LLongParam);
#endif
return (*this)(VCA_BuffParam, VI_ResultSize);
}/*
ZCStringStd& operator()(ZTypULLong AULL_LLongParam)*/
ZCStringStd& operator()(double AD_DoubleParam)
{
const int CI_BuffSize=51 ;
char VCA_BuffParam[CI_BuffSize];
int VI_ResultSize = ::sprintf
(
VCA_BuffParam, "%f", AD_DoubleParam
);
/////////////////////////////
return (*this)(VCA_BuffParam);
}/*
ZCStringStd& operator()(double AD_DoubleParam)*/
public:
};/*
class ZCStringStd : public std::string*/