From 3a73a7501c5e29d13f83339deb87754a922a72c1 Mon Sep 17 00:00:00 2001 From: sauron Date: Sun, 24 Aug 2025 23:37:52 +0900 Subject: [PATCH] commit 2025-08-24 23:37 add ZCppMain/ZMainCGI.H and ZCppMainTest/ZMainCGI_000_EnvSet.cpp --- ZCppMain/ZMainHeadEx.H | 26 +++---- ZCppMain/ZtCLoadDataBlock.H | 7 +- ZCppMainTest/ZMainCGI_000_EnvSet.cpp | 135 +++++++++++++++++++++++++++++++++++ ZCppMainTest/ZtCArray_000.cpp | 8 ++- ZCppMainTest/ZtCLoadXml_000.cpp | 8 ++- ZCppMainTest/ZtCObjAVL_000.cpp | 8 ++- 6 files changed, 167 insertions(+), 25 deletions(-) create mode 100644 ZCppMainTest/ZMainCGI_000_EnvSet.cpp diff --git a/ZCppMain/ZMainHeadEx.H b/ZCppMain/ZMainHeadEx.H index 5de52e5..4655a50 100644 --- a/ZCppMain/ZMainHeadEx.H +++ b/ZCppMain/ZMainHeadEx.H @@ -4914,9 +4914,10 @@ namespace ZNsMain //////////////////////////////////////////////////////////////////////////////////////////////////////*/ - template - static ZNsMain::ZNsEnum::ZERun IterDirEx( - ZTypCPCh APC_DirPath, TViewDir AR_CViewDir, TTypeHelp AR_CTypeHelp) + template + + static ZNsMain::ZNsEnum::ZERun IterDirEx + ( ZTypCPCh APC_DirPath, TViewDir AR_CViewDir, TTypeHelp AR_CTypeHelp ) { using ZNsMain::ZNsEnum::ZERun ; using ZNsMain::ZNsEnum::ZERun_OK; @@ -5072,20 +5073,21 @@ namespace ZNsMain return VE_ERun; }/* - template - static ZNsMain::ZNsEnum::ZERun IterDirEx( - ZTypCPCh APC_DirPath, TViewDir AR_CViewDir, TTypeHelp AR_CTypeHelp) */ + template + + static ZNsMain::ZNsEnum::ZERun IterDirEx + ( ZTypCPCh APC_DirPath, TViewDir AR_CViewDir, TTypeHelp AR_CTypeHelp ) */ // APC_DirPath 는 디렉토리 구분자로 끝나지 않게 하자. - static ZNsMain::ZNsEnum::ZERun IterFile + static ZNsMain::ZNsEnum::ZERun IterFile /*#################################*/ ( ZTypCPCh APC_DirPath, void* APC_VoidKey, ZNsMain::ZNsEnum::ZERun (*APF_EachFile)(ZTypCPCh APC_NowPath, ZCFileData& AR_CFileData, void* APC_VoidKey), ZNsMain::ZNsEnum::ZERun (*APF_EachDir )(ZTypCPCh APC_NowPath, ZCFileData& AR_CFileData, void* APC_VoidKey)=0 ) - /////////////////////////////////////// + /*##########################################################################*/ { ZNsMain::ZNsEnum::ZERun VE_ERun=ZNsMain::ZNsEnum::ZERun_OK; @@ -5152,7 +5154,7 @@ namespace ZNsMain dirent VO_DirEnt; #endif dirent* VP_DirEnt; - TypeDirID VH_File= ::opendir(APC_DirPath); + TypeDirID VH_File = ::opendir(APC_DirPath) ; char VCA_Search[_MAX_PATH2+1]={_T('0')}; if(VH_File==NULL) @@ -5164,7 +5166,7 @@ namespace ZNsMain while(VP_DirEnt= ::readdir(VH_File)) #endif { - const bool CB_IsNotValid=( + const bool CB_IsNotValid = ( ::strcmp(".", VP_DirEnt->d_name)==0 || ::strcmp("..", VP_DirEnt->d_name)==0 /*//////////*/ ); @@ -5218,13 +5220,13 @@ namespace ZNsMain return VE_ERun; }/* - static ZNsMain::ZNsEnum::ZERun IterFile + static ZNsMain::ZNsEnum::ZERun IterFile #################################### ( ZTypCPCh APC_DirPath, void* APC_VoidKey, ZNsMain::ZNsEnum::ZERun (*APF_EachFile)(ZTypCPCh APC_NowPath, ZCFileData& AR_CFileData, void* APC_VoidKey), ZNsMain::ZNsEnum::ZERun (*APF_EachDir )(ZTypCPCh APC_NowPath, ZCFileData& AR_CFileData, void* APC_VoidKey)=0 ) - /////////////////////////////////////*/ + /*##########################################################################*/ /*//////////////////////////////////////////////////// diff --git a/ZCppMain/ZtCLoadDataBlock.H b/ZCppMain/ZtCLoadDataBlock.H index f8d7494..5b1d5b7 100644 --- a/ZCppMain/ZtCLoadDataBlock.H +++ b/ZCppMain/ZtCLoadDataBlock.H @@ -133,7 +133,7 @@ namespace ZNsMain }/* if(mb_DoFindStart==true)*/ - return GetChildObj.ExecBlockOut(APC_Data, AL_Length); + return GetChildObj().ExecBlockOut(APC_Data, AL_Length); }/* _NP_ ZERun OnMeetNormal(const TypeChar* APC_Data, TypeLength AL_Length)*/ @@ -343,9 +343,8 @@ namespace ZNsMain template ZERun LoadData( const TypeChar* APC_Data, TypeLength AL_Length, THelpType AO_CHelpType) { - typedef ZNsMain:: - ZtCCheckRef ZCCheckRef; - typedef ZCCheckRef::TypeData TypeObject; + typedef ZNsMain::ZtCCheckRef ZCCheckRef; + typedef typename ZCCheckRef::TypeData TypeObject; bool VB_IsOK =false ; ZTypLength VL_StartPos=0 ; diff --git a/ZCppMainTest/ZMainCGI_000_EnvSet.cpp b/ZCppMainTest/ZMainCGI_000_EnvSet.cpp new file mode 100644 index 0000000..bc0d42e --- /dev/null +++ b/ZCppMainTest/ZMainCGI_000_EnvSet.cpp @@ -0,0 +1,135 @@ + + +#include "ZCppMain/ZMainCGI.H" + + +using namespace std ; +using namespace ZNsMain; + + +namespace ZNsMain +{ + + namespace ZNsExam + { + + template class ZtCExam_CLoadSimUrlConfig + { + public: + typedef ZtCStringBase ZCStringBase ; + typedef ZNsCGI::ZtCLoadSimUrlConfig + ZCLoadSimUrlConfig; + public: + + static int Main(int AR_ArgCnt, char* APP_ArgVal[]) + { + ZCLoadSimUrlConfig VO_CLoadSimUrlConfig ; + ZCStringBase VO_CStringBase + ("Example : name1 =value1 &name2 = value2 "); + + if(AR_ArgCnt>=2) + { VO_CStringBase = APP_ArgVal[1]; } + + VO_CLoadSimUrlConfig.LoadData(VO_CStringBase); + VO_CLoadSimUrlConfig.IterEnvSet(); + + return 0; /*::::::::::::::::::::*/ + }/* + static int Main(int AR_ArgCnt, char* APP_ArgVal[])*/ + + public: + };/* + template class ZtCExam_CLoadSimUrlConfig*/ + + }/* + namespace ZNsExam*/ + +}/* +namespace ZNsMain*/ + + +int main(int AI_ArgCnt, char* APP_ArgVal[]) +{ + return ZNsMain::ZNsExam:: + + ZtCExam_CLoadSimUrlConfig<>::Main(AI_ArgCnt, APP_ArgVal); +}/* +int main(int AI_ArgCnt, char* APP_ArgVal[])*/ + + +/*//////////////////////////////////////////////////////////////////////////////////////// + + cigwin + + // g++ -mno-cygwin -o ZMainCGI_000_EnvSet.exe ZMainCGI_000_EnvSet.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 + // g++ -mno-cygwin -o ZMainCGI_000_EnvSet_D.exe ZMainCGI_000_EnvSet.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG + + mingw + + g++.exe -o ZMainCGI_000_EnvSet_mw.exe ZMainCGI_000_EnvSet.cpp -I../ -lWs2_32 + g++.exe -o ZMainCGI_000_EnvSet_mw_D.exe ZMainCGI_000_EnvSet.cpp -I../ -lWs2_32 -D_DEBUG + + ./ZMainCGI_000_EnvSet_mw.exe + ./ZMainCGI_000_EnvSet_mw_D.exe + + ./ZMainCGI_000_EnvSet_mw.exe "name1=value1 & mid & name2= value2" + + + Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest + # date + Sun Aug 24 10:47:09 KST 2025 + + Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest + # g++ --version + g++.exe (Rev2, Built by MSYS2 project) 13.2.0 + Copyright (C) 2023 Free Software Foundation, Inc. + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + + Linux + + g++ -std=c++98 -o ZMainCGI_000_EnvSet.exe ZMainCGI_000_EnvSet.cpp -I../ + g++ -std=c++98 -o ZMainCGI_000_EnvSet_D.exe ZMainCGI_000_EnvSet.cpp -I../ -D_DEBUG + + sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version + gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 + Copyright (C) 2019 Free Software Foundation, Inc. + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date + Sun Aug 24 00:05:51 DST 2025 + + sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release + NAME="Ubuntu" + VERSION="20.04.6 LTS (Focal Fossa)" + ID=ubuntu + ID_LIKE=debian + PRETTY_NAME="Ubuntu 20.04.6 LTS" + VERSION_ID="20.04" + HOME_URL="https://www.ubuntu.com/" + SUPPORT_URL="https://help.ubuntu.com/" + BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" + PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" + VERSION_CODENAME=focal + UBUNTU_CODENAME=focal + + + [sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release + CentOS Linux release 7.9.2009 (Core) + + [sauron@q381-2657 ZCppMainTest]$ g++ --version + g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44) + Copyright (C) 2015 Free Software Foundation, Inc. + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + + + ./ZMainCGI_000_EnvSet.exe + ./ZMainCGI_000_EnvSet_D.exe + + ./ZMainCGI_000_EnvSet.exe "name1=value1 & mid & name2= value2" + +////////////////////////////////////////////////////////////////////////////////////////*/ diff --git a/ZCppMainTest/ZtCArray_000.cpp b/ZCppMainTest/ZtCArray_000.cpp index d478119..eeff52b 100644 --- a/ZCppMainTest/ZtCArray_000.cpp +++ b/ZCppMainTest/ZtCArray_000.cpp @@ -179,11 +179,13 @@ namespace ZNsMain namespace ZNsMain*/ -int main(int AR_ArgCnt, char* APP_ArgVal[]) +int main(int AI_ArgCnt, char* APP_ArgVal[]) { - return ZNsMain::ZNsExam::ZtCExamArray<>::Main(); + return ZNsMain::ZNsExam:: + + ZtCExamArray<>::Main(AI_ArgCnt, APP_ArgVal); }/* -int main(int AR_ArgCnt, char* APP_ArgVal[])*/ +int main(int AI_ArgCnt, char* APP_ArgVal[])*/ /*//////////////////////////////////////////////////////////////////////////////////////// diff --git a/ZCppMainTest/ZtCLoadXml_000.cpp b/ZCppMainTest/ZtCLoadXml_000.cpp index 7f631e8..16dc2c0 100644 --- a/ZCppMainTest/ZtCLoadXml_000.cpp +++ b/ZCppMainTest/ZtCLoadXml_000.cpp @@ -150,11 +150,13 @@ namespace ZNsMain namespace ZNsMain*/ -int main(int AR_ArgCnt, char* APP_ArgVal[]) +int main(int AI_ArgCnt, char* APP_ArgVal[]) { - return ZNsMain::ZNsExam::ZtExamLoadXml<>::Main(); + return ZNsMain::ZNsExam:: + + ZtExamLoadXml<>::Main(AI_ArgCnt, APP_ArgVal); }/* -int main(int AR_ArgCnt, char* APP_ArgVal[])*/ +int main(int AI_ArgCnt, char* APP_ArgVal[])*/ /*//////////////////////////////////////////////////////////////////////////////////////// diff --git a/ZCppMainTest/ZtCObjAVL_000.cpp b/ZCppMainTest/ZtCObjAVL_000.cpp index 40dbe16..c472fbe 100644 --- a/ZCppMainTest/ZtCObjAVL_000.cpp +++ b/ZCppMainTest/ZtCObjAVL_000.cpp @@ -56,11 +56,13 @@ namespace ZNsMain namespace ZNsMain*/ -int main(int AR_ArgCnt, char* APP_ArgVal[]) +int main(int AI_ArgCnt, char* APP_ArgVal[]) { - return ZNsMain::ZNsExam::ZtCExamAVL<>::Main(); + return ZNsMain::ZNsExam:: + + ZtCExamAVL<>::Main(AI_ArgCnt, APP_ArgVal); }/* -int main(int AR_ArgCnt, char* APP_ArgVal[])*/ +int main(int AI_ArgCnt, char* APP_ArgVal[])*/ /*////////////////////////////////////////////////////////////////////////////////////////