From fa658801cf1062ea3acac537dda8bd5bd77f8eee Mon Sep 17 00:00:00 2001 From: sauron Date: Mon, 1 Sep 2025 14:07:33 +0900 Subject: [PATCH] commit 2025-09-01 14:07 is coding ZCppMain/ZCStringStd.H --- ZCppMain/ZCStringStd.H | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ ZCppMain/ZMainHead.H | 4 +++ 2 files changed, 83 insertions(+) create mode 100644 ZCppMain/ZCStringStd.H diff --git a/ZCppMain/ZCStringStd.H b/ZCppMain/ZCStringStd.H new file mode 100644 index 0000000..5631268 --- /dev/null +++ b/ZCppMain/ZCStringStd.H @@ -0,0 +1,79 @@ + + +#ifndef __ZCPPMAIIN_ZCSTRINGSTD_H__ +#define __ZCPPMAIIN_ZCSTRINGSTD_H__ + + +#include +#include "ZCppMain/ZtCMainChars.H" + + +namespace ZNsMain +{ + + class ZCStringStd : public std::string + { + public: + typedef ZNsChars::ZNsType::ZtCTypeChars ZCTypeChars; + typedef ZNsChars::ZtCMainChars 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 void FindPosToList + (const char* APC_SearchData, TypeLength AL_SearchLen, TPosList& ARR_CPosList) + { + // TPosList : ZNsMain::ZtCList 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 void FindPosToList + (const char* APC_SearchData, TypeLength AL_SearchLen, TFindList& ARR_CPosList) + */ + + public: + };/* + class ZCStringStd : public std::string*/ + + +}/* +namespace ZNsMain*/ + + +#endif //__ZCPPMAIIN_ZCSTRINGSTD_H__ diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index 700c9e7..e97734f 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -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 void IterElement(TFunctor AO_Functor) { ZCLink* VP_LoopLink=mp_HeadLink;