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
{
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
< typename TTypString = std::string >
class ZtCStringStd : public TTypString

View File

@ -14,24 +14,33 @@ namespace ZNsMain
namespace ZNsExam
{
typedef ZtCStringStd<string> ZCStringStd ;
typedef ZtCStringStd<wstring> ZCStringStdW ;
typedef ZtCStringStd<string> ZCStringStd ;
typedef ZtCStringStd<wstring> ZCStringStdW ;
typedef ZtCStringBase<char> ZCStringBase ;
typedef ZtCStringBase<wchar_t> ZCStringBaseW ;
typedef ZtCStringBase<char> ZCStringBase ;
typedef ZtCStringBase<wchar_t> ZCStringBaseW ;
typedef ZCStringBase ::ZCCharView ZCCharView ;
typedef ZCStringBaseW::ZCCharView ZCCharViewW ;
typedef ZtCCharType<ZCStringBase> ZCCharType ;
typedef ZtCCharType<ZCStringBaseW> ZCCharTypeW ;
typedef ZCStringBase ::ZCCharView ZCCharView ;
typedef ZCStringBaseW::ZCCharView ZCCharViewW ;
typedef ZtCCharType<ZCStringBase> ZCCharType ;
typedef ZtCCharType<ZCStringBaseW> ZCCharTypeW ;
typedef ZtCCharType<ZCStringStd > ZCCharTypeS ;
typedef ZtCCharType<ZCStringStdW > ZCCharTypeSW ;
typedef ZCCharType ::TypeChar TypeChar ;
typedef ZCCharTypeW::TypeChar TypeCharW ;
typedef ZCCharType ::TypeInt TypeCharInt ;
typedef ZCCharTypeW::TypeInt TypeCharIntW ;
typedef ZCCharType ::TypeChar TypeChar ;
typedef ZCCharTypeW ::TypeChar TypeCharW ;
typedef ZCCharType ::TypeInt TypeCharInt ;
typedef ZCCharTypeW ::TypeInt TypeCharIntW ;
const int CI_ByteSize = ZCCharType ::CI_ByteSize ;
const int CI_ByteSizeW= ZCCharTypeW::CI_ByteSize ;
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_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
@ -40,16 +49,24 @@ namespace ZNsMain
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
{
cout<<"# TypeChar ="<<typeid(TypeChar ).name()<<endl;
cout<<"# TypeCharW ="<<typeid(TypeCharW ).name()<<endl;
cout<<"# TypeCharInt ="<<typeid(TypeCharInt ).name()<<endl;
cout<<"# TypeCharIntW="<<typeid(TypeCharIntW).name()<<endl;
cout<<"# CI_ByteSize ="<<CI_ByteSize <<endl;
cout<<"# CI_ByteSizeW="<<CI_ByteSizeW <<endl;
cout<<"# TypeChar ="<<typeid(TypeChar ).name()<<endl;
cout<<"# TypeCharW ="<<typeid(TypeCharW ).name()<<endl;
cout<<"# TypeCharInt ="<<typeid(TypeCharInt ).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_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<<"# ZCStringBaseW::TypeCharInt="<<typeid(ZCStringBaseW::TypeCharInt).name()<<endl;
cout<<"*****************************************************"<<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<<"# 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<<"*****************************************************"<<endl;
ZCStringBaseW VO_ZCStringBaseW;
ZCStringStdW VO_ZCStringStdW ;