80 lines
2.4 KiB
C++
80 lines
2.4 KiB
C++
|
|
|
|
#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__
|