commit 2025-10-09 13:30 add ZtCCharType< ZtCStringStd<TTypeBaseStr> > : ZCppMain/ZtCStringStd.H

This commit is contained in:
2025-10-09 13:30:32 +09:00
parent c31fd0b671
commit 22ce305df6
2 changed files with 67 additions and 22 deletions

View File

@ -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

View File

@ -17,21 +17,30 @@ namespace ZNsMain
typedef ZtCStringStd<string> ZCStringStd ; typedef ZtCStringStd<string> ZCStringStd ;
typedef ZtCStringStd<wstring> ZCStringStdW ; typedef ZtCStringStd<wstring> ZCStringStdW ;
typedef ZtCStringBase<char> ZCStringBase ; typedef ZtCStringBase<char> ZCStringBase ;
typedef ZtCStringBase<wchar_t> ZCStringBaseW ; typedef ZtCStringBase<wchar_t> ZCStringBaseW ;
typedef ZCStringBase ::ZCCharView ZCCharView ; typedef ZCStringBase ::ZCCharView ZCCharView ;
typedef ZCStringBaseW::ZCCharView ZCCharViewW ; typedef ZCStringBaseW::ZCCharView ZCCharViewW ;
typedef ZtCCharType<ZCStringBase> ZCCharType ; typedef ZtCCharType<ZCStringBase> ZCCharType ;
typedef ZtCCharType<ZCStringBaseW> ZCCharTypeW ; typedef ZtCCharType<ZCStringBaseW> ZCCharTypeW ;
typedef ZtCCharType<ZCStringStd > ZCCharTypeS ;
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 ;
typedef ZCCharTypeS ::TypeChar TypeCharS ;
typedef ZCCharTypeSW::TypeChar TypeCharSW ;
typedef ZCCharTypeS ::TypeInt TypeCharIntS ;
typedef ZCCharTypeSW::TypeInt TypeCharIntSW ;
const int CI_ByteSize = ZCCharType ::CI_ByteSize; const int CI_ByteSize = ZCCharType ::CI_ByteSize;
const int CI_ByteSizeW = ZCCharTypeW ::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
@ -44,12 +53,20 @@ namespace ZNsMain
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<<"*****************************************************"<<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_ByteSize ="<<CI_ByteSize <<endl;
cout<<"# CI_ByteSizeW ="<<CI_ByteSizeW <<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 ;