From 22ce305df6885a7de093f88731ee9866ffd7568c Mon Sep 17 00:00:00 2001 From: sauron Date: Thu, 9 Oct 2025 13:30:32 +0900 Subject: [PATCH] commit 2025-10-09 13:30 add ZtCCharType< ZtCStringStd > : ZCppMain/ZtCStringStd.H --- ZCppMain/ZtCStringStd.H | 27 +++++++++++++++++ ZCppMainTest/ZtCStringBase_000.cpp | 62 ++++++++++++++++++++++++-------------- 2 files changed, 67 insertions(+), 22 deletions(-) diff --git a/ZCppMain/ZtCStringStd.H b/ZCppMain/ZtCStringStd.H index 9171a57..fa7c0f8 100644 --- a/ZCppMain/ZtCStringStd.H +++ b/ZCppMain/ZtCStringStd.H @@ -11,6 +11,33 @@ namespace ZNsMain { + + template class ZtCStringStd; + + + template ////////////////////////////////////////////////////////////////// + < + template class ZtCStringStd, typename TTypeBaseStr + > + /*#######################################################################*/ + class ZtCCharType< ZtCStringStd > + { + public: + typedef ZtCStringStd 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 diff --git a/ZCppMainTest/ZtCStringBase_000.cpp b/ZCppMainTest/ZtCStringBase_000.cpp index 33a47e3..7719550 100644 --- a/ZCppMainTest/ZtCStringBase_000.cpp +++ b/ZCppMainTest/ZtCStringBase_000.cpp @@ -14,24 +14,33 @@ namespace ZNsMain namespace ZNsExam { - typedef ZtCStringStd ZCStringStd ; - typedef ZtCStringStd ZCStringStdW ; + typedef ZtCStringStd ZCStringStd ; + typedef ZtCStringStd ZCStringStdW ; + typedef ZtCStringBase ZCStringBase ; + typedef ZtCStringBase ZCStringBaseW ; - typedef ZtCStringBase ZCStringBase ; - typedef ZtCStringBase ZCStringBaseW ; - typedef ZCStringBase ::ZCCharView ZCCharView ; - typedef ZCStringBaseW::ZCCharView ZCCharViewW ; - typedef ZtCCharType ZCCharType ; - typedef ZtCCharType ZCCharTypeW ; + typedef ZCStringBase ::ZCCharView ZCCharView ; + typedef ZCStringBaseW::ZCCharView ZCCharViewW ; + typedef ZtCCharType ZCCharType ; + typedef ZtCCharType ZCCharTypeW ; + typedef ZtCCharType ZCCharTypeS ; + typedef ZtCCharType 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 class ZtCExamCStringBase_000 @@ -40,16 +49,24 @@ namespace ZNsMain static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0) { - cout<<"# TypeChar ="<