From 56fe85472374f6430e1bc0738fc8b7210af358e6 Mon Sep 17 00:00:00 2001 From: sauron Date: Sun, 17 Aug 2025 01:06:21 +0900 Subject: [PATCH] commit 2025-08-16 34:34 edit ZCppMain/ZtCLoadDataBlock.H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ZCLoadDataBlock1 과 ZCLoadDataBlock2 의 소속을 ZNsExam 에서 ZNsExam::ZtCDummy 로 옮김 --- ZCppMain/ZtCLoadDataBlock.H | 375 ++++++++++++++++++++++---------------------- 1 file changed, 189 insertions(+), 186 deletions(-) diff --git a/ZCppMain/ZtCLoadDataBlock.H b/ZCppMain/ZtCLoadDataBlock.H index 76144bd..e2a34db 100644 --- a/ZCppMain/ZtCLoadDataBlock.H +++ b/ZCppMain/ZtCLoadDataBlock.H @@ -115,9 +115,9 @@ namespace ZNsMain TStringData mo_BlockBuffCStr; // mo_StartMarkCStr, mo_CloseMarkCStr 사이에 있는 데이타는 여기에 쌓아둔다. bool mb_DoFindStart ; // mo_StartMarkCStr 을 찾은 상태라면 true - #define __GET_CHILD_OBJ__ (static_cast(*this)) - - /*protected:*/ + //protected: + private : + TDerive& GetChildObj(){ return static_cast(*this); } public : _NP_ ZERun OnMeetNormal(const TypeChar* APC_Data, TypeLength AL_Length) @@ -133,7 +133,7 @@ namespace ZNsMain }/* if(mb_DoFindStart==true)*/ - return __GET_CHILD_OBJ__.ExecBlockOut(APC_Data, AL_Length); + return GetChildObj.ExecBlockOut(APC_Data, AL_Length); }/* _NP_ ZERun OnMeetNormal(const TypeChar* APC_Data, TypeLength AL_Length)*/ @@ -153,11 +153,11 @@ namespace ZNsMain }/* if(mb_DoFindStart==true)*/ - return __GET_CHILD_OBJ__.ExecBlockOut + return GetChildObj().ExecBlockOut ( APC_Data, AL_Length, ZCCheckRef::PassData(AO_CHelpType) ); - ///////////////////////////////////// + ///////////////////////////////// }/* template _NP_ ZERun OnMeetNormal( const TypeChar* APC_Data, TypeLength AL_Length, THelpType AO_CHelpType) */ @@ -182,11 +182,11 @@ namespace ZNsMain if(TBooIncMark==true) mo_BlockBuffCStr.append(mo_CloseMarkCStr); - if(__GET_CHILD_OBJ__.ExecBlockIn(mo_BlockBuffCStr)==ZERun_NO) + if(GetChildObj().ExecBlockIn(mo_BlockBuffCStr)==ZERun_NO) { mo_BlockBuffCStr=""; return ZERun_NO; }/* - if(__GET_CHILD_OBJ__.ExecBlockIn(mo_BlockBuffCStr)==ZERun_NO)*/ + if(GetChildObj().ExecBlockIn(mo_BlockBuffCStr)==ZERun_NO)*/ mo_BlockBuffCStr=""; }/* @@ -226,13 +226,13 @@ namespace ZNsMain if(TBooIncMark==true) { mo_BlockBuffCStr.append(mo_CloseMarkCStr); } - if ( __GET_CHILD_OBJ__.ExecBlockIn + if ( GetChildObj().ExecBlockIn ( mo_BlockBuffCStr, ZCCheckRef::PassData(AO_CHelpType) ) ==ZERun_NO ) - /////////////////////////////////// + /////////////////////////////// { mo_BlockBuffCStr=""; return ZERun_NO; } @@ -412,11 +412,11 @@ namespace ZNsMain void FiniBuff() { - if(mb_DoFindStart==true ) __GET_CHILD_OBJ__. + if(mb_DoFindStart==true ) GetChildObj(). ExecBlockOut(mo_StartMarkCStr.data(), mo_StartMarkCStr.size()); - if(mo_BlockBuffCStr.size()>0) __GET_CHILD_OBJ__. + if(mo_BlockBuffCStr.size()>0) GetChildObj(). ExecBlockOut(mo_BlockBuffCStr.data(), mo_MarkBuffCStr.size()); - if(mo_MarkBuffCStr .size()>0) __GET_CHILD_OBJ__. + if(mo_MarkBuffCStr .size()>0) GetChildObj(). ExecBlockOut(mo_MarkBuffCStr. data(), mo_MarkBuffCStr. size()); }/* void FiniBuff()*/ @@ -425,19 +425,16 @@ namespace ZNsMain { typedef ZNsMain::ZtCCheckRef ZCCheckRef; - if(mb_DoFindStart==true ) __GET_CHILD_OBJ__.ExecBlockOut + if(mb_DoFindStart==true ) GetChildObj().ExecBlockOut (mo_StartMarkCStr.data(), mo_StartMarkCStr.size(), ZCCheckRef::PassData(AO_CHelpType)); - if(mo_BlockBuffCStr.size()>0) __GET_CHILD_OBJ__.ExecBlockOut + if(mo_BlockBuffCStr.size()>0) GetChildObj().ExecBlockOut (mo_BlockBuffCStr.data(), mo_BlockBuffCStr.size(), ZCCheckRef::PassData(AO_CHelpType)); - if(mo_MarkBuffCStr .size()>0) __GET_CHILD_OBJ__.ExecBlockOut + if(mo_MarkBuffCStr .size()>0) GetChildObj().ExecBlockOut (mo_MarkBuffCStr. data(), mo_MarkBuffCStr. size(), ZCCheckRef::PassData(AO_CHelpType)); }/* template void FiniBuff(THelpType AO_CHelpType) */ - #undef __GET_CHILD_OBJ__ - - public: };/* template< typename TDerive , @@ -733,168 +730,176 @@ namespace ZNsMain template class ZtCExamReadyExec*/ - - typedef ZNsMain::ZtCStringBase ZCStringBase; - - - class ZCLoadDataBlock1 : public ZNsMain:: - ZtCLoadDataBlock + template class ZtCDummy { - protected: + public: + typedef ZNsMain::ZtCStringBase ZCStringBase; + typedef typename ZCStringBase::TypeChar TypeChar ; + public: - friend class ZNsMain::ZtCLoadDataBlock; - /*////////////////////////////////////////////////////////////////////// - - ■ ZNsMain::ZtCLoadDataBlock 을 TypeBase - 로 typedef 하고 friend class TypeBase 라 하면 g++ 에서는 컴파일이 안 - 된다. - - CLoadDataBlock_test.cpp:26: error: - using typedef-name `std::CLoadDataBlock::TypeBase' after `class' - - Visual C++ 2008 에서는 컴파일되는데, 이점은 Visual C++ 쪽이 좀 더 합 - 리적인 것 같다. - - -- 2008-12-10 21:14:00 - - //////////////////////////////////////////////////////////////////////*/ - - protected: - - ZERun ExecBlockIn(const ZCStringBase& AR_CString) + class ZCLoadDataBlock1 : public ZNsMain:: + ZtCLoadDataBlock { - cout<<"▷ Search Data Block IN =>\""< ZERun ExecBlockIn - (const ZCStringBase& AR_CStringData, THelpObj AO_HelpObj) - { - cout<<"Help:Search Data Block IN =>\""< ZERun ExecBlockIn - (const ZCStringBase& AR_CStringData, THelpObj AO_HelpObj)*/ + friend class ZNsMain::ZtCLoadDataBlock; + /*////////////////////////////////////////////////////////////////////// - ZERun ExecBlockOut(const char* AP_Data, long AL_Length) - { - if(AL_Length>0) - cout<<"▷ Search Data Block OUT=>\"" ; - else cout<<"▷ Search Data Block OUT=>\"NULL"; + ■ ZNsMain::ZtCLoadDataBlock 을 TypeBase + 로 typedef 하고 friend class TypeBase 라 하면 g++ 에서는 컴파일이 안 + 된다. - for(long i=0;i\""< ZERun ExecBlockOut - (const TypeChar* AP_Data, ZTypLength AL_Length, THelpObj AO_HelpObj) - { - if(AL_Length>0) - cout<<"▷ Help:Search Data Block OUT=>\"" ; - else cout<<"▷ Help:Search Data Block OUT=>\"NULL"; - - for(long i=0;i ZERun ExecBlockIn + (const ZCStringBase& AR_CStringData, THelpObj AO_HelpObj) { - cout.put( AP_Data[i] ); - } - ///////////////////////////// + cout<<"Help:Search Data Block IN =>\""< ZERun ExecBlockIn + (const ZCStringBase& AR_CStringData, THelpObj AO_HelpObj)*/ - cout<<"\""< ZERun ExecBlockOut ZERun ExecBlockOut - (const TypeChar* AP_Data, ZTypLength AL_Length, THelpObj AO_HelpObj)*/ - protected: + ZERun ExecBlockOut(const char* AP_Data, long AL_Length) + { + if(AL_Length>0) + cout<<"▷ Search Data Block OUT=>\"" ; + else cout<<"▷ Search Data Block OUT=>\"NULL"; + + for(long i=0;i ZERun ExecBlockOut + (const TypeChar* AP_Data, ZTypLength AL_Length, THelpObj AO_HelpObj) + { + if(AL_Length>0) + cout<<"▷ Help:Search Data Block OUT=>\"" ; + else cout<<"▷ Help:Search Data Block OUT=>\"NULL"; + + for(long i=0;i ZERun ExecBlockOut ZERun ExecBlockOut + (const TypeChar* AP_Data, ZTypLength AL_Length, THelpObj AO_HelpObj)*/ + + protected: + };/* + class ZCLoadDataBlock1 : public ZNsMain:: + ZtCLoadDataBlock*/ + + + class ZCLoadDataBlock2 : public ZNsMain:: + ZtCLoadDataBlock + { + protected: + + friend class ZNsMain::ZtCLoadDataBlock; + + /*////////////////////////////////////////////////////////////////////// + + ■ ZNsMain::ZtCLoadDataBlock 을 TypeBase + 로 typedef 하고 friend class TypeBase 라 하면 g++ 에서는 컴파일이 안 + 된다. + + CLoadDataBlock_test.cpp:26: error: + using typedef-name `std::CLoadDataBlock::TypeBase' after `class' + + Visual C++ 2008 에서는 컴파일되는데, 이점은 Visual C++ 쪽이 좀 더 합 + 리적인 것 같다. + + -- 2008-12-10 21:14:00 + + //////////////////////////////////////////////////////////////////////*/ + + protected: + + ZERun ExecBlockIn(const ZCStringBase& AR_CString) + { + cout<<"▷ Search2 Data Block IN =>\""< ZERun ExecBlockIn + (const ZCStringBase& AR_CStringData, THelpObj& AO_HelpObj) + { + cout<<"Help2:Search2 Data Block IN =>\""< ZERun ExecBlockIn + (const ZCStringBase& AR_CStringData, THelpObj& AO_HelpObj)*/ + + + ZERun ExecBlockOut(const char* AP_Data, long AL_Length) + { + if(AL_Length>0) + cout<<"▷ Search2 Data Block OUT=>\"" ; + else cout<<"▷ Search2 Data Block OUT=>\"NULL"; + + for(long i=0;i ZERun ExecBlockOut + (const TypeChar* AP_Data, ZTypLength AL_Length, THelpObj& AO_HelpObj) + { + if(AL_Length>0) + cout<<"▷ Help2:Search2 Data Block OUT=>\"" ; + else cout<<"▷ Help2:Search2 Data Block OUT=>\"NULL"; + + for(long i=0;i ZERun ExecBlockOut ZERun ExecBlockOut + (const TypeChar* AP_Data, ZTypLength AL_Length, THelpObj& AO_HelpObj)*/ + + protected: + };/* + class ZCLoadDataBlock2 : public ZNsMain:: + ZtCLoadDataBlock*/ + + public: };/* - class ZCLoadDataBlock1 : public ZNsMain:: - ZtCLoadDataBlock*/ - - - class ZCLoadDataBlock2 : public ZNsMain:: - ZtCLoadDataBlock - { - protected: - - friend class ZNsMain::ZtCLoadDataBlock; - - /*////////////////////////////////////////////////////////////////////// - - ■ ZNsMain::ZtCLoadDataBlock 을 TypeBase - 로 typedef 하고 friend class TypeBase 라 하면 g++ 에서는 컴파일이 안 - 된다. - - CLoadDataBlock_test.cpp:26: error: - using typedef-name `std::CLoadDataBlock::TypeBase' after `class' - - Visual C++ 2008 에서는 컴파일되는데, 이점은 Visual C++ 쪽이 좀 더 합 - 리적인 것 같다. - - -- 2008-12-10 21:14:00 - - //////////////////////////////////////////////////////////////////////*/ - - protected: - - ZERun ExecBlockIn(const ZCStringBase& AR_CString) - { - cout<<"▷ Search2 Data Block IN =>\""< ZERun ExecBlockIn - (const ZCStringBase& AR_CStringData, THelpObj& AO_HelpObj) - { - cout<<"Help2:Search2 Data Block IN =>\""< ZERun ExecBlockIn - (const ZCStringBase& AR_CStringData, THelpObj& AO_HelpObj)*/ - - - ZERun ExecBlockOut(const char* AP_Data, long AL_Length) - { - if(AL_Length>0) - cout<<"▷ Search2 Data Block OUT=>\"" ; - else cout<<"▷ Search2 Data Block OUT=>\"NULL"; - - for(long i=0;i ZERun ExecBlockOut - (const TypeChar* AP_Data, ZTypLength AL_Length, THelpObj& AO_HelpObj) - { - if(AL_Length>0) - cout<<"▷ Help2:Search2 Data Block OUT=>\"" ; - else cout<<"▷ Help2:Search2 Data Block OUT=>\"NULL"; - - for(long i=0;i ZERun ExecBlockOut ZERun ExecBlockOut - (const TypeChar* AP_Data, ZTypLength AL_Length, THelpObj& AO_HelpObj)*/ - - protected: - };/* - class ZCLoadDataBlock2 : public ZNsMain:: - ZtCLoadDataBlock*/ + template class ZtCDummy*/ template class ZtCExamLoadDataBlock @@ -917,11 +922,13 @@ namespace ZNsMain static int Main(int AI_ArgCnt=0, const char* APA_ArgVal[]=0) { - ZNsExam::ZCLoadDataBlock1 VO_CLoadDataBlock1; - ZNsExam::ZCLoadDataBlock2 VO_CLoadDataBlock2; + typedef ZNsMain ::ZtCStringBase ZCStringBase ; + + ZNsExam::ZtCDummy<>::ZCLoadDataBlock1 VO_CLoadDataBlock1; + ZNsExam::ZtCDummy<>::ZCLoadDataBlock2 VO_CLoadDataBlock2; ZCHelpObj VO_CHelpObj ; - ///////////////////////////////////////////// + ///////////////////////////////////////////////////////// ZCStringBase VO_CStringBase1 ( @@ -932,7 +939,7 @@ namespace ZNsMain ( "}}" ); - ///////////////////////////////////////////// + ///////////////////////////////////////////////////////// VO_CLoadDataBlock1.GetStartMark()="{{"; VO_CLoadDataBlock1.GetCloseMark()="}}"; @@ -1547,9 +1554,9 @@ namespace ZNsMain public : typedef TStringData ZCStringData; public : - typedef typename ZCStringData::TypeChar TypeChar ; - typedef typename ZCStringData::TypeLength TypeLength ; - typedef typename ZCStringData::ZCMainChars ZCMainChars ; + typedef typename ZCStringData::TypeChar TypeChar ; + typedef typename ZCStringData::TypeLength TypeLength ; + typedef typename ZCStringData::ZCMainChars ZCMainChars; protected: ZCStringData mo_CStrSearch ; // 찾아야 하는 값 ZCStringData mo_CStringBuff; @@ -1814,7 +1821,7 @@ namespace ZNsMain typename TTypeBase=ZNsIFace:: ZtCChildLoadDataBlockOne > - class ZtCTypeLoadDataBlockOne /////////////////////////////////////////////// + class ZtCTypeLoadDataBlockOne /////////////////////// { public: @@ -1823,7 +1830,7 @@ namespace ZNsMain public ZNsMain::ZtCLoadDataBlockOne < ZCLoadDataBlock, TStringData - /*//////////*/ > + /*##########*/ > /*######################################*/ { public: typedef TStringData ZCStringData; @@ -1831,13 +1838,8 @@ namespace ZNsMain typedef typename ZCStringData::TypeChar TypeChar ; typedef typename ZCStringData::TypeLength TypeLength ; public: - };/* - class ZCLoadDataBlock : - public TTypeBase, - public ZNsMain::ZtCLoadDataBlockOne - < - ZCLoadDataBlock, TStringData - ////////////// > */ + }; + /*########################################################*/ typedef TStringData ZCStringData; typedef typename ZCStringData::ZCMainChars ZCMainChars ; @@ -1847,10 +1849,11 @@ namespace ZNsMain public: };/* - template< typename TStringData, - typename TTypeBase=ZNsIFace::ZtCChildLoadDataBlockOne + template< typename TStringData , + typename TTypeBase=ZNsIFace:: + ZtCChildLoadDataBlockOne > - class ZtCTypeLoadDataBlockOne /////////////////////////////////////////////*/ + class ZtCTypeLoadDataBlockOne /////////////////////*/ }/* namespace ZNsType*/