commit 2025-08-20 17:30 edit a bit ZtCStringBase
This commit is contained in:
@ -1197,8 +1197,11 @@ namespace ZNsMain
|
|||||||
}/*
|
}/*
|
||||||
if(AL_Length<1)*/
|
if(AL_Length<1)*/
|
||||||
|
|
||||||
ReAlloc(AL_Length); ::memcpy(
|
ReAlloc(AL_Length); ::memcpy
|
||||||
mpc_Data, APC_Data, AL_Length*sizeof(TypeChar));
|
(
|
||||||
|
mpc_Data, APC_Data, AL_Length*sizeof(TypeChar)
|
||||||
|
);
|
||||||
|
/////////////////////////////
|
||||||
|
|
||||||
mpc_Data[ml_UseLen=AL_Length]=0; return *this;
|
mpc_Data[ml_UseLen=AL_Length]=0; return *this;
|
||||||
}/*
|
}/*
|
||||||
@ -1207,12 +1210,19 @@ namespace ZNsMain
|
|||||||
|
|
||||||
ZCStringBase& operator()(TypeCharC* APC_Data, TypeLength AL_Length)
|
ZCStringBase& operator()(TypeCharC* APC_Data, TypeLength AL_Length)
|
||||||
{
|
{
|
||||||
if(mpc_Data==APC_Data || AL_Length<1) return *this;
|
if(mpc_Data==APC_Data || AL_Length<1)
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
/////////////////////////////////////
|
||||||
|
|
||||||
ReAllocKeep(ml_UseLen+AL_Length);
|
ReAllocKeep(ml_UseLen+AL_Length);
|
||||||
|
|
||||||
::memcpy(
|
::memcpy ////////////////////////////
|
||||||
mpc_Data+ml_UseLen, APC_Data, AL_Length*sizeof(TypeChar));
|
(
|
||||||
|
mpc_Data+ml_UseLen, APC_Data, AL_Length*sizeof(TypeChar)
|
||||||
|
);
|
||||||
|
/////////////////////////////////////
|
||||||
|
|
||||||
mpc_Data[ml_UseLen+=AL_Length]=0; return *this;
|
mpc_Data[ml_UseLen+=AL_Length]=0; return *this;
|
||||||
}/*
|
}/*
|
||||||
@ -1277,7 +1287,7 @@ namespace ZNsMain
|
|||||||
{
|
{
|
||||||
const int CI_BuffSize=21; char VCA_BuffParam[CI_BuffSize];
|
const int CI_BuffSize=21; char VCA_BuffParam[CI_BuffSize];
|
||||||
|
|
||||||
int VI_ResultSize=::sprintf(VCA_BuffParam, "%u", AUI_UIntParam);
|
int VI_ResultSize = ::sprintf(VCA_BuffParam, "%u", AUI_UIntParam);
|
||||||
|
|
||||||
return (*this)(VCA_BuffParam, VI_ResultSize);
|
return (*this)(VCA_BuffParam, VI_ResultSize);
|
||||||
}/*
|
}/*
|
||||||
@ -1336,9 +1346,15 @@ namespace ZNsMain
|
|||||||
const int CI_BuffSize=51 ;
|
const int CI_BuffSize=51 ;
|
||||||
char VCA_BuffParam[CI_BuffSize];
|
char VCA_BuffParam[CI_BuffSize];
|
||||||
|
|
||||||
int VI_ResultSize=::sprintf(VCA_BuffParam, "%f", AD_DoubleParam);
|
int VI_ResultSize = ::sprintf
|
||||||
|
(
|
||||||
|
VCA_BuffParam, "%f", AD_DoubleParam
|
||||||
|
);
|
||||||
|
/////////////////////////////
|
||||||
|
|
||||||
TrimDecimalZero(VCA_BuffParam, VI_ResultSize); return (*this)(VCA_BuffParam);
|
TrimDecimalZero(VCA_BuffParam, VI_ResultSize);
|
||||||
|
|
||||||
|
return (*this)(VCA_BuffParam);
|
||||||
}/*
|
}/*
|
||||||
ZCStringBase& operator()(double AD_DoubleParam)*/
|
ZCStringBase& operator()(double AD_DoubleParam)*/
|
||||||
|
|
||||||
@ -1482,7 +1498,7 @@ namespace ZNsMain
|
|||||||
|
|
||||||
if(AL_StartPos>=ml_AllLen) return *this ;
|
if(AL_StartPos>=ml_AllLen) return *this ;
|
||||||
|
|
||||||
do ////
|
do /////////
|
||||||
{
|
{
|
||||||
if(mpc_Data[AL_StartPos++]==0) break;
|
if(mpc_Data[AL_StartPos++]==0) break;
|
||||||
}
|
}
|
||||||
@ -1524,8 +1540,8 @@ namespace ZNsMain
|
|||||||
|
|
||||||
// Index1 번째 문자부터 VL_Index2 번째 문자까지 정수로 읽는다.
|
// Index1 번째 문자부터 VL_Index2 번째 문자까지 정수로 읽는다.
|
||||||
|
|
||||||
TypeChar* VP_Char=
|
TypeChar* VP_Char = this->
|
||||||
this->NewMem(AL_Index2-AL_Index1+1+1/*Null Char*/);
|
NewMem(AL_Index2-AL_Index1+1+1/*Null Char*/);
|
||||||
|
|
||||||
if(VP_Char==0)
|
if(VP_Char==0)
|
||||||
{
|
{
|
||||||
@ -1539,7 +1555,7 @@ namespace ZNsMain
|
|||||||
{
|
{
|
||||||
VP_Char[i]=mpc_Data[AL_Index1+i];
|
VP_Char[i]=mpc_Data[AL_Index1+i];
|
||||||
}/*
|
}/*
|
||||||
for(i=0;i<=AL_Index2-AL_Index1;++i)*/
|
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
|
||||||
|
|
||||||
/*######*/ VP_Char[i] =0 ;
|
/*######*/ VP_Char[i] =0 ;
|
||||||
TypeLength VB_Return = ZNsMain::ATOL(VP_Char);
|
TypeLength VB_Return = ZNsMain::ATOL(VP_Char);
|
||||||
@ -1576,7 +1592,9 @@ namespace ZNsMain
|
|||||||
{
|
{
|
||||||
// VL_Index 부터 APC_Search 을 찾아서 그 앞에까지만 정수로 읽는다.
|
// VL_Index 부터 APC_Search 을 찾아서 그 앞에까지만 정수로 읽는다.
|
||||||
|
|
||||||
if(ml_UseLen<1 || AL_Index>=ml_UseLen) return 0;
|
if(ml_UseLen<1 || AL_Index>=ml_UseLen)
|
||||||
|
{return 0;}
|
||||||
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
|
||||||
|
|
||||||
TypeLength VL_Pos = FindPos
|
TypeLength VL_Pos = FindPos
|
||||||
(APC_Search, AL_SearchLen, AL_Index);
|
(APC_Search, AL_SearchLen, AL_Index);
|
||||||
@ -1585,7 +1603,7 @@ namespace ZNsMain
|
|||||||
|
|
||||||
if(VL_Pos<0) VL_Pos=ml_UseLen-1;
|
if(VL_Pos<0) VL_Pos=ml_UseLen-1;
|
||||||
|
|
||||||
return ReadLongFromIndex(AL_Index,VL_Pos-1);
|
return ReadLongFromIndex(AL_Index, VL_Pos-1);
|
||||||
}/*
|
}/*
|
||||||
TypeLength ReadLong(
|
TypeLength ReadLong(
|
||||||
TypeLength AL_Index, TypeCharC* APC_Search, TypeLength AL_SearchLen)*/
|
TypeLength AL_Index, TypeCharC* APC_Search, TypeLength AL_SearchLen)*/
|
||||||
@ -1624,12 +1642,14 @@ namespace ZNsMain
|
|||||||
ZCStringBase& ARR_CString, TypeLength AL_Index1, TypeLength AL_Index2)*/
|
ZCStringBase& ARR_CString, TypeLength AL_Index1, TypeLength AL_Index2)*/
|
||||||
|
|
||||||
|
|
||||||
ZCStringBase& ReadString( ////////////////////////////////////////
|
ZCStringBase& ReadString ////////////////////////
|
||||||
|
(
|
||||||
ZCStringBase& ARR_CString,
|
ZCStringBase& ARR_CString,
|
||||||
TypeLength AL_Index ,
|
TypeLength AL_Index ,
|
||||||
TypeCharC* APC_Search ,
|
TypeCharC* APC_Search ,
|
||||||
TypeLength AL_SearchLen
|
TypeLength AL_SearchLen
|
||||||
/*/////////*/ ) /*/////////////////////////////////////////////*/
|
)
|
||||||
|
/*/////////////////////////////////////////////*/
|
||||||
{
|
{
|
||||||
// AL_Index 번째 문자부터 APC_Search 문자를 찾아서 그 앞부분까지 ARR_CString 에 전달한다.
|
// AL_Index 번째 문자부터 APC_Search 문자를 찾아서 그 앞부분까지 ARR_CString 에 전달한다.
|
||||||
|
|
||||||
@ -1647,12 +1667,14 @@ namespace ZNsMain
|
|||||||
return ReadString
|
return ReadString
|
||||||
(ARR_CString, AL_Index, VL_Pos);
|
(ARR_CString, AL_Index, VL_Pos);
|
||||||
}/*
|
}/*
|
||||||
ZCStringBase& ReadString( ////////////////////////////////////////
|
ZCStringBase& ReadString ////////////////////////
|
||||||
|
(
|
||||||
ZCStringBase& ARR_CString,
|
ZCStringBase& ARR_CString,
|
||||||
TypeLength AL_Index ,
|
TypeLength AL_Index ,
|
||||||
TypeCharC* APC_Search ,
|
TypeCharC* APC_Search ,
|
||||||
TypeLength AL_SearchLen
|
TypeLength AL_SearchLen
|
||||||
///////////// ) ///////////////////////////////////////////////*/
|
)
|
||||||
|
///////////////////////////////////////////////*/
|
||||||
|
|
||||||
|
|
||||||
// AL_Index 번째 부터 끝문자까지의 데이타를 가져온다.
|
// AL_Index 번째 부터 끝문자까지의 데이타를 가져온다.
|
||||||
@ -1720,19 +1742,26 @@ namespace ZNsMain
|
|||||||
ZCStringBase& FormatAdd(TypeLength AL_FormatSize, TypeCharC* APC_Format, ...)*/
|
ZCStringBase& FormatAdd(TypeLength AL_FormatSize, TypeCharC* APC_Format, ...)*/
|
||||||
|
|
||||||
|
|
||||||
ZCStringBase& ReplaceChar(
|
ZCStringBase& ReplaceChar
|
||||||
TypeChar AC_SearchChar, TypeChar AC_ReplaceChar, TypeLength AI_StartPos=0)
|
(
|
||||||
|
TypeChar AC_SearchChar, TypeChar AC_ReplaceChar, TypeLength AI_StartPos=0
|
||||||
|
)
|
||||||
|
/////////////////////////
|
||||||
{
|
{
|
||||||
for(TypeLength i=AI_StartPos;i<ml_UseLen;++i)
|
for(TypeLength i=AI_StartPos; i<ml_UseLen; ++i)
|
||||||
{
|
{
|
||||||
if(mpc_Data[i]==AC_SearchChar) mpc_Data[i]=AC_ReplaceChar;
|
if(mpc_Data[i]==AC_SearchChar) mpc_Data[i]=AC_ReplaceChar;
|
||||||
}/*
|
}/*
|
||||||
for(TypeLength i=AI_StartPos;i<ml_UseLen;++i)*/
|
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}/*
|
}/*
|
||||||
ZCStringBase& ReplaceChar(
|
ZCStringBase& ReplaceChar
|
||||||
TypeChar AC_SearchChar, TypeChar AC_ReplaceChar, TypeLength AI_StartPos=0)*/
|
(
|
||||||
|
TypeChar AC_SearchChar, TypeChar AC_ReplaceChar, TypeLength AI_StartPos=0
|
||||||
|
)
|
||||||
|
///////////////////////*/
|
||||||
|
|
||||||
|
|
||||||
ZCStringBase& ReplaceOnce
|
ZCStringBase& ReplaceOnce
|
||||||
(
|
(
|
||||||
|
Reference in New Issue
Block a user