commit 2025-10-09 13:30 add ZtCCharType< ZtCStringStd<TTypeBaseStr> > : ZCppMain/ZtCStringStd.H
This commit is contained in:
@ -11,6 +11,33 @@
|
|||||||
namespace ZNsMain
|
namespace ZNsMain
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
template<typename TTypString> class ZtCStringStd;
|
||||||
|
|
||||||
|
|
||||||
|
template //////////////////////////////////////////////////////////////////
|
||||||
|
<
|
||||||
|
template<typename> class ZtCStringStd, typename TTypeBaseStr
|
||||||
|
>
|
||||||
|
/*#######################################################################*/
|
||||||
|
class ZtCCharType< ZtCStringStd<TTypeBaseStr> >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef ZtCStringStd<TTypeBaseStr> TypeCStr ;
|
||||||
|
typedef typename TypeCStr::traits_type::char_type TypeChar ;
|
||||||
|
typedef typename TypeCStr::traits_type::int_type TypeInt ;
|
||||||
|
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||||
|
static const int CI_ByteSize = sizeof(TypeChar) ;
|
||||||
|
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||||
|
public:
|
||||||
|
typedef TypeChar char_type ; // for stl string/wstring
|
||||||
|
typedef TypeInt int_type ; // for stl string/wstring
|
||||||
|
public:
|
||||||
|
};/*
|
||||||
|
class ZtCCharType /*#####################################################*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template
|
template
|
||||||
< typename TTypString = std::string >
|
< typename TTypString = std::string >
|
||||||
class ZtCStringStd : public TTypString
|
class ZtCStringStd : public TTypString
|
||||||
|
@ -14,24 +14,33 @@ namespace ZNsMain
|
|||||||
|
|
||||||
namespace ZNsExam
|
namespace ZNsExam
|
||||||
{
|
{
|
||||||
typedef ZtCStringStd<string> ZCStringStd ;
|
typedef ZtCStringStd<string> ZCStringStd ;
|
||||||
typedef ZtCStringStd<wstring> ZCStringStdW ;
|
typedef ZtCStringStd<wstring> ZCStringStdW ;
|
||||||
|
|
||||||
|
typedef ZtCStringBase<char> ZCStringBase ;
|
||||||
|
typedef ZtCStringBase<wchar_t> ZCStringBaseW ;
|
||||||
|
|
||||||
typedef ZtCStringBase<char> ZCStringBase ;
|
typedef ZCStringBase ::ZCCharView ZCCharView ;
|
||||||
typedef ZtCStringBase<wchar_t> ZCStringBaseW ;
|
typedef ZCStringBaseW::ZCCharView ZCCharViewW ;
|
||||||
typedef ZCStringBase ::ZCCharView ZCCharView ;
|
typedef ZtCCharType<ZCStringBase> ZCCharType ;
|
||||||
typedef ZCStringBaseW::ZCCharView ZCCharViewW ;
|
typedef ZtCCharType<ZCStringBaseW> ZCCharTypeW ;
|
||||||
typedef ZtCCharType<ZCStringBase> ZCCharType ;
|
typedef ZtCCharType<ZCStringStd > ZCCharTypeS ;
|
||||||
typedef ZtCCharType<ZCStringBaseW> ZCCharTypeW ;
|
typedef ZtCCharType<ZCStringStdW > ZCCharTypeSW ;
|
||||||
|
|
||||||
typedef ZCCharType ::TypeChar TypeChar ;
|
typedef ZCCharType ::TypeChar TypeChar ;
|
||||||
typedef ZCCharTypeW::TypeChar TypeCharW ;
|
typedef ZCCharTypeW ::TypeChar TypeCharW ;
|
||||||
typedef ZCCharType ::TypeInt TypeCharInt ;
|
typedef ZCCharType ::TypeInt TypeCharInt ;
|
||||||
typedef ZCCharTypeW::TypeInt TypeCharIntW ;
|
typedef ZCCharTypeW ::TypeInt TypeCharIntW ;
|
||||||
|
|
||||||
const int CI_ByteSize = ZCCharType ::CI_ByteSize ;
|
typedef ZCCharTypeS ::TypeChar TypeCharS ;
|
||||||
const int CI_ByteSizeW= ZCCharTypeW::CI_ByteSize ;
|
typedef ZCCharTypeSW::TypeChar TypeCharSW ;
|
||||||
|
typedef ZCCharTypeS ::TypeInt TypeCharIntS ;
|
||||||
|
typedef ZCCharTypeSW::TypeInt TypeCharIntSW ;
|
||||||
|
|
||||||
|
const int CI_ByteSize = ZCCharType ::CI_ByteSize;
|
||||||
|
const int CI_ByteSizeW = ZCCharTypeW ::CI_ByteSize;
|
||||||
|
const int CI_ByteSizeS = ZCCharTypeS ::CI_ByteSize;
|
||||||
|
const int CI_ByteSizeSW = ZCCharTypeSW::CI_ByteSize;
|
||||||
|
|
||||||
|
|
||||||
template<typename TDummy=void*> class ZtCExamCStringBase_000
|
template<typename TDummy=void*> class ZtCExamCStringBase_000
|
||||||
@ -40,16 +49,24 @@ namespace ZNsMain
|
|||||||
|
|
||||||
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
|
||||||
{
|
{
|
||||||
cout<<"# TypeChar ="<<typeid(TypeChar ).name()<<endl;
|
cout<<"# TypeChar ="<<typeid(TypeChar ).name()<<endl;
|
||||||
cout<<"# TypeCharW ="<<typeid(TypeCharW ).name()<<endl;
|
cout<<"# TypeCharW ="<<typeid(TypeCharW ).name()<<endl;
|
||||||
cout<<"# TypeCharInt ="<<typeid(TypeCharInt ).name()<<endl;
|
cout<<"# TypeCharInt ="<<typeid(TypeCharInt ).name()<<endl;
|
||||||
cout<<"# TypeCharIntW="<<typeid(TypeCharIntW).name()<<endl;
|
cout<<"# TypeCharIntW ="<<typeid(TypeCharIntW ).name()<<endl;
|
||||||
cout<<"# CI_ByteSize ="<<CI_ByteSize <<endl;
|
cout<<"*****************************************************"<<endl;
|
||||||
cout<<"# CI_ByteSizeW="<<CI_ByteSizeW <<endl;
|
cout<<"# TypeCharS ="<<typeid(TypeCharS ).name()<<endl;
|
||||||
|
cout<<"# TypeCharSW ="<<typeid(TypeCharSW ).name()<<endl;
|
||||||
|
cout<<"# TypeCharIntS ="<<typeid(TypeCharIntS ).name()<<endl;
|
||||||
|
cout<<"# TypeCharIntSW="<<typeid(TypeCharIntSW).name()<<endl;
|
||||||
|
cout<<"*****************************************************"<<endl;
|
||||||
|
cout<<"# CI_ByteSize ="<<CI_ByteSize <<endl;
|
||||||
|
cout<<"# CI_ByteSizeW ="<<CI_ByteSizeW <<endl;
|
||||||
|
cout<<"# CI_ByteSizeS ="<<CI_ByteSizeS <<endl;
|
||||||
|
cout<<"# CI_ByteSizeSW="<<CI_ByteSizeSW <<endl;
|
||||||
|
cout<<"*****************************************************"<<endl;
|
||||||
cout<<"# ZCStringBase ::TypeCharInt="<<typeid(ZCStringBase ::TypeCharInt).name()<<endl;
|
cout<<"# ZCStringBase ::TypeCharInt="<<typeid(ZCStringBase ::TypeCharInt).name()<<endl;
|
||||||
cout<<"# ZCStringBaseW::TypeCharInt="<<typeid(ZCStringBaseW::TypeCharInt).name()<<endl;
|
cout<<"# ZCStringBaseW::TypeCharInt="<<typeid(ZCStringBaseW::TypeCharInt).name()<<endl;
|
||||||
|
cout<<"*****************************************************"<<endl;
|
||||||
cout<<"# ZCStringBase ::traits_type::char_type="<<typeid(ZCStringBase ::traits_type::char_type).name()<<endl;
|
cout<<"# ZCStringBase ::traits_type::char_type="<<typeid(ZCStringBase ::traits_type::char_type).name()<<endl;
|
||||||
cout<<"# ZCStringBaseW::traits_type::char_type="<<typeid(ZCStringBaseW::traits_type::char_type).name()<<endl;
|
cout<<"# ZCStringBaseW::traits_type::char_type="<<typeid(ZCStringBaseW::traits_type::char_type).name()<<endl;
|
||||||
cout<<"# ZCStringBase ::traits_type::int_type ="<<typeid(ZCStringBase ::traits_type::int_type ).name()<<endl;
|
cout<<"# ZCStringBase ::traits_type::int_type ="<<typeid(ZCStringBase ::traits_type::int_type ).name()<<endl;
|
||||||
@ -59,6 +76,7 @@ namespace ZNsMain
|
|||||||
cout<<"# ZCStringBaseW::traits_type="<<typeid(ZCStringBaseW::traits_type).name()<<endl;
|
cout<<"# ZCStringBaseW::traits_type="<<typeid(ZCStringBaseW::traits_type).name()<<endl;
|
||||||
cout<<"*****************************************************"<<endl;
|
cout<<"*****************************************************"<<endl;
|
||||||
|
|
||||||
|
|
||||||
ZCStringBaseW VO_ZCStringBaseW;
|
ZCStringBaseW VO_ZCStringBaseW;
|
||||||
ZCStringStdW VO_ZCStringStdW ;
|
ZCStringStdW VO_ZCStringStdW ;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user