commit 2025-09-01 14:07 is coding ZCppMain/ZCStringStd.H

This commit is contained in:
2025-09-01 14:07:33 +09:00
parent 6142ecd2e9
commit fa658801cf
2 changed files with 83 additions and 0 deletions

79
ZCppMain/ZCStringStd.H Normal file
View File

@ -0,0 +1,79 @@
#ifndef __ZCPPMAIIN_ZCSTRINGSTD_H__
#define __ZCPPMAIIN_ZCSTRINGSTD_H__
#include<string>
#include "ZCppMain/ZtCMainChars.H"
namespace ZNsMain
{
class ZCStringStd : public std::string
{
public:
typedef ZNsChars::ZNsType::ZtCTypeChars<char> ZCTypeChars;
typedef ZNsChars::ZtCMainChars<ZCTypeChars> ZCMainChars;
public:
typedef char TypeData ;
typedef std::string TypeBase ;
typedef std::string TypeStrStd;
typedef ZTypLength TypeLength;
typedef ZTypLength TypeSize ;
public:
ZCStringStd(): TypeStrStd(){}
ZCStringStd(const ZCStringStd& rhs): TypeStrStd(rhs){}
ZCStringStd(const char* APC_Origin, TypeLength AL_Length): TypeStrStd(APC_Origin, AL_Length){}
ZCStringStd(const char* APC_Origin): TypeStrStd(APC_Origin){}
ZCStringStd& operator==(const ZCStringStd& rhs)
{
this->TypeStrStd::operator=(rhs); return *this;
}/*
ZCStringStd& operator==(const ZCStringStd& rhs)*/
template<typename TPosList> void FindPosToList
(const char* APC_SearchData, TypeLength AL_SearchLen, TPosList& ARR_CPosList)
{
// TPosList : ZNsMain::ZtCList<TypeLength> etc
if(this->size()<1) return;
const char* VPC_OriginStart = this->data();
TypeLength VL_OriginLen = this->size();
TypeLength VL_FindPos = -1 ;
TypeLength VL_Offset = 0 ;
while /*::::::::::::::::::::::::::::::::::::::::::::::*/
( ( VL_FindPos = ZCMainChars::FindPos
( VPC_OriginStart, APC_SearchData,
VL_OriginLen , AL_SearchLen, VL_Offset
)
)
>= 0
)
/*::::::::::::::::::::::::::::::::::::::::::::::::::::*/
{
ARR_CPosList.push_back(VL_FindPos);
VL_Offset = VL_FindPos + AL_SearchLen;
}
/*::::::::::::::::::::::::::::::::::::::::::::::::::::*/
}/*
template<typename TPosList> void FindPosToList
(const char* APC_SearchData, TypeLength AL_SearchLen, TFindList& ARR_CPosList)
*/
public:
};/*
class ZCStringStd : public std::string*/
}/*
namespace ZNsMain*/
#endif //__ZCPPMAIIN_ZCSTRINGSTD_H__

View File

@ -3879,6 +3879,10 @@ namespace ZNsMain
operator TypeData&(){ return AddTail(); }
void push_back (TypeArg AO_ArgData){AddTail(AO_ArgData);}
void push_front(TypeArg AO_ArgData){AddHead(AO_ArgData);}
template<typename TFunctor> void IterElement(TFunctor AO_Functor)
{
ZCLink* VP_LoopLink=mp_HeadLink;