diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index 849f754..5a433f2 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -2102,7 +2102,7 @@ namespace ZNsMain ////////////////////////////////////////////// { public: - TType* NewMem (size_t AL_AllocSize){return (TType*)::malloc(AL_AllocSize) ;} + TType* NewMem (size_t AL_AllocSize){return (TType*)::malloc(AL_AllocSize) ;} TType* NewArrMem(size_t AL_AllocSize){return (TType*)::malloc(AL_AllocSize*sizeof(TType));} public: void DeleteMem(void* AP_Void){if(AP_Void!=0) ::free(AP_Void);} @@ -2474,7 +2474,7 @@ namespace ZNsMain inline ZTypLength ZftLength(const TTypeCh* ApcChar) */ template - inline TTypeSize ZfLengthType(const TTypeCh* ApcChar) + inline TTypeSize ZftLengthType(const TTypeCh* ApcChar) { return ZftGetLengthType(ApcChar); }/* diff --git a/ZCppMain/ZtCStringEx.H b/ZCppMain/ZtCStringEx.H index 8a2b30a..36cdd79 100644 --- a/ZCppMain/ZtCStringEx.H +++ b/ZCppMain/ZtCStringEx.H @@ -207,7 +207,7 @@ namespace ZNsMain ZtCCharPtr& Add(TypeChar* APC_ArgChar) { - return Add(APC_ArgChar, ZNsMain::ZftGetLengthType(APC_ArgChar)); + return Add(APC_ArgChar, GetLength(APC_ArgChar)); }/* ZtCCharPtr& Add(TypeChar* APC_ArgChar)*/ @@ -432,6 +432,14 @@ namespace ZNsMain public: + static TypeLength GetLength(const TypeChar* AP_Data) + { + return ZNsMain::ZftGetLengthType(AP_Data) ; + } + //////////////////////////////////////////////////// + + public: + template void MakeInfoList ( @@ -593,8 +601,7 @@ namespace ZNsMain MakeWord //////////////////////////////// ( - APC_Data, ZNsMain::ZftGetLengthType - < TypeLength, TypeChar >( APC_Data ) + APC_Data, GetLength(APC_Data) ); ///////////////////////////////////////// }/* @@ -968,8 +975,7 @@ namespace ZNsMain { return InvalidHead ( - APC_Search, ZNsMain::ZftGetLengthType - < TypeLength, TypeChar >( APC_Search ) + APC_Search, GetLength(APC_Search) ); ////////////////// }/* @@ -1022,8 +1028,7 @@ namespace ZNsMain return MakeWord ( - APC_Data, ZNsMain::ZftGetLengthType - < TypeLength, TypeChar >( APC_Data ) + APC_Data, GetLength(APC_Data) ); /////////////// }/* @@ -1073,11 +1078,10 @@ namespace ZNsMain if(APC_Data==0 || APC_Data[0]+=0) return *this; ZCStringBase VO_CStringTemp; - TypeLength VL_ArgLen = ZNsMain:: - ZftGetLengthType(APC_Data); + TypeLength VL_ArgLen =GetLength(APC_Data); VO_CStringTemp.ReAlloc(ml_UseLen+VL_ArgLen); - VO_CStringTemp(*this)(APC_Data, VL_ArgLen ); + VO_CStringTemp(*this) (APC_Data, VL_ArgLen); return VO_CStringTemp; }/* @@ -1118,8 +1122,7 @@ namespace ZNsMain ZCStringBase& operator-(TypeCharC* APC_Data) { - TypeLength VL_Length = ZNsMain:: - ZftGetLengthType(APC_Data); + TypeLength VL_Length = GetLength(APC_Data) ; if(this->DoStart(APC_Data, VL_Length)==true) MoveFirst(VL_Length); @@ -1130,8 +1133,7 @@ namespace ZNsMain ZCStringBase& operator-=(TypeCharC* APC_Data) { - TypeLength VL_Length = ZNsMain:: - ZftGetLengthType(APC_Data); + TypeLength VL_Length = GetLength(APC_Data) ; if(this->DoStart(APC_Data, VL_Length)==true) MoveFirst(VL_Length); @@ -1218,7 +1220,7 @@ namespace ZNsMain ZCStringBase& operator()(TypeCharC* APC_Data) { - return (*this)(APC_Data, ZNsMain::ZftGetLengthType(APC_Data)); + return (*this)(APC_Data, GetLength(APC_Data)); }/* ZCStringBase& operator()(TypeCharC* APC_Data)*/ @@ -1763,13 +1765,11 @@ namespace ZNsMain ZCStringBase& ReplaceOnce( TypeCharC* APC_Search, TypeCharC* APC_Replace, TypeLength AL_StartPos=0) { - using ZNsMain::ZftGetLengthType ; - return ReplaceOnce( ///////////////////////////////////////////////// APC_Search , APC_Replace , - ZftGetLengthType(APC_Search) , - ZftGetLengthType(APC_Replace) , + GetLength(APC_Search) , + GetLength(APC_Replace) , AL_StartPos /*/////////*/ ); //////////////////////////////////////////////////// }/* @@ -2093,14 +2093,12 @@ namespace ZNsMain ) ///////////////////// { - using ZNsMain::ZftGetLengthType ; - return Replace ///////////////////////////////////////////// ( APC_Search , APC_Replace , - ZftGetLengthType(APC_Search ), - ZftGetLengthType(APC_Replace), + GetLength(APC_Search ), + GetLength(APC_Replace), AL_StartPos ); //////////////////////////////////////////////////////////// @@ -2117,14 +2115,12 @@ namespace ZNsMain ) //////////////////////////////////////////////////////////// { - using ZNsMain::ZftGetLengthType ; - return ReplaceType ( - APC_Search , - APC_Replace , - ZftGetLengthType(APC_Search) , - ZftGetLengthType(APC_Replace) , + APC_Search , + APC_Replace , + GetLength(APC_Search) , + GetLength(APC_Replace), AL_StartPos ); /////////////////////////////////// @@ -2310,15 +2306,13 @@ namespace ZNsMain TypeCharC* APC_Replace /*/////////*/ ) //////////////////////////////////////////////////////////////// { - using ZNsMain::ZftGetLengthType; - return ReplaceSection( ARR_Saver , ////////////////////////////////////// APC_Origin , AL_SectPos , AL_SectLen , APC_Replace , - ZftGetLengthType(APC_Origin ), - ZftGetLengthType(APC_Replace) + GetLength(APC_Origin ), + GetLength(APC_Replace) /*////////////////*/ ) ; }/* static ZCStringBase& ReplaceSection( //////////////////////////////////////////// @@ -2580,17 +2574,15 @@ namespace ZNsMain bool AB_IsExactTwo =true /*/////////*/ ) /////////////////////////////////////////////// { - using ZNsMain::ZftGetLengthType ; - return ReplaceRange( //////////////////////////////////////////////// APC_Search1 , APC_Search2 , APC_Replace , AB_DoKeepSearch , AL_StartPos , - ZftGetLengthType(APC_Search1), - ZftGetLengthType(APC_Search2), - ZftGetLengthType(APC_Replace), + GetLength(APC_Search1), + GetLength(APC_Search2), + GetLength(APC_Replace), AB_IsExactTwo /*//////////*/ ); /////////////////////////////////////////////////// }/* @@ -2727,17 +2719,15 @@ namespace ZNsMain TypeLength AL_StartPos =0 /*/////////*/ ) /////////////////////////////////////////////// { - using ZNsMain::ZftGetLengthType ; - return ReplaceAllRange( //////////////////////////////////////////// APC_Search1 , APC_Search2 , APC_Replace , AB_DoKeepSearch , AL_StartPos , - ZftGetLengthType(APC_Search1), - ZftGetLengthType(APC_Search2), - ZftGetLengthType(APC_Replace) + GetLength(APC_Search1), + GetLength(APC_Search2), + GetLength(APC_Replace) /*/////////*/ ); }/* ZCStringBase& ReplaceAllRange( //////////////////////////////// @@ -2855,8 +2845,7 @@ namespace ZNsMain { return Insert_E ( - AL_InsertPos, APC_Insert, ZNsMain:: - ZftGetLengthType(APC_Insert) + AL_InsertPos, APC_Insert, GetLength(APC_Insert) ) ; /////////////// }/* @@ -3060,17 +3049,15 @@ namespace ZNsMain bool AB_IsExactTwo=false /*#########*/ ) const /*########################################*/ { - using ZNsMain::ZftGetLengthType ; - return GetSubSearch( ////////////////////////////////////////////// - mpc_Data , - APC_Find1 , - APC_Find2 , - ml_UseLen , - ZftGetLengthType(APC_Find1), - ZftGetLengthType(APC_Find2), - RR(ARRL_StartPos), - RR(ARR_CString) , + mpc_Data , + APC_Find1 , + APC_Find2 , + ml_UseLen , + GetLength(APC_Find1), + GetLength(APC_Find2), + RR(ARRL_StartPos) , + RR(ARR_CString) , AB_IsExactTwo /*/////////*/ ); ////////////////////////////////////////////////// }/* @@ -3092,17 +3079,15 @@ namespace ZNsMain { TypeLength VL_StartPos=0; - using ZNsMain::ZftGetLengthType ; - return GetSubSearch( ////////////////////////////////////////////// - mpc_Data , - APC_Find1 , - APC_Find2 , - ml_UseLen , - ZftGetLengthType(APC_Find1), - ZftGetLengthType(APC_Find2), - RR(VL_StartPos) , - RR(ARR_CString) , + mpc_Data , + APC_Find1 , + APC_Find2 , + ml_UseLen , + GetLength(APC_Find1), + GetLength(APC_Find2), + RR(VL_StartPos) , + RR(ARR_CString) , AB_IsExactTwo /*/////////*/ ); ////////////////////////////////////////////////// }/* @@ -3295,15 +3280,13 @@ namespace ZNsMain bool AB_IsExactTwo=false /*//////////*/ ) ////////////////////////////////////////////////// { - using ZNsMain::ZftGetLengthType ; - return GetSubSearchEx( ///////////////////////////////////////////// - APC_Origin , - AR_FindList1 , - AR_FindList2 , - ZftGetLengthType(APC_Origin), - ARRL_StartPos , - ARR_CString , + APC_Origin , + AR_FindList1 , + AR_FindList2 , + GetLength(APC_Origin) , + ARRL_StartPos , + ARR_CString , AB_IsExactTwo /*//////////*/ ); ////////////////////////////////////////////////// }/* @@ -3996,8 +3979,7 @@ namespace ZNsMain mpc_Data , APC_SearchChar , ml_UseLen , - TypeLength(ZNsMain::ZftGetLengthType - (APC_SearchChar)), + TypeLength(GetLength(APC_SearchChar)), AB_DoEndWhenNoMatch , AB_DoAppendEachLink , AB_DoAppendEmpty @@ -4226,8 +4208,6 @@ namespace ZNsMain bool AB_DoAppendEachLink=false /*/////////*/ ) const //////////////////////////////////////////// { - using ZNsMain::ZftGetLengthType ; - return ZCMainChars::SplitToListWrap( //////////////////////////////////// RR(ARR_SaveList), mpc_Data , @@ -4235,9 +4215,9 @@ namespace ZNsMain APC_WrapStart , APC_WrapClose , ml_UseLen , - ZftGetLengthType(APC_SearchChar), - ZftGetLengthType(APC_WrapStart) , - ZftGetLengthType(APC_WrapClose) , + GetLength(APC_SearchChar), + GetLength(APC_WrapStart ), + GetLength(APC_WrapClose ), AB_DoEndWhenNoMatch, AB_DoAppendEachLink /*//////////*/ ); /////////////////////////////////////////////////////// @@ -4348,8 +4328,7 @@ namespace ZNsMain mpc_Data , APC_SearchChar , ml_UseLen , - ZNsMain::ZftGetLengthType - (APC_SearchChar) + GetLength(APC_SearchChar) /*/////////*/ ); }/* template TStringList& SplitByCondOr( /////// @@ -4751,14 +4730,16 @@ namespace ZNsMain /*##############################################################*/ - ZCStringList& ExtractBetweenToList( ////////////////////////////// - ZCStringList& ARR_SaveList , - TypeCharC* APC_Search1Char, - TypeCharC* APC_Search2Char, - TypeLength AL_Search1Len , - TypeLength AL_Search2Len , - bool AB_DoIncludeSearch=false - /*/////////*/ ) const //////////////////////////////////////////// + ZCStringList& ExtractBetweenToList /*##########################*/ + ( + ZCStringList& ARR_SaveList , + TypeCharC* APC_Search1Char, + TypeCharC* APC_Search2Char, + TypeLength AL_Search1Len , + TypeLength AL_Search2Len , + bool AB_DoIncludeSearch=false + ) const + /*##############################################################*/ { return ExtractBetweenToList( //////////// ARR_SaveList , @@ -4771,41 +4752,45 @@ namespace ZNsMain AB_DoIncludeSearch /*/////////*/ ); //////////////////////// }/* - ZCStringList& ExtractBetweenToList( ////////////////////////////// - ZCStringList& ARR_SaveList , - TypeCharC* APC_Search1Char , - TypeCharC* APC_Search2Char , - TypeLength AL_Search1Len , - TypeLength AL_Search2Len , - bool AB_DoIncludeSearch=false - //////////// ) const /////////////////////////////////////////*/ + ZCStringList& ExtractBetweenToList ############################## + ( + ZCStringList& ARR_SaveList , + TypeCharC* APC_Search1Char , + TypeCharC* APC_Search2Char , + TypeLength AL_Search1Len , + TypeLength AL_Search2Len , + bool AB_DoIncludeSearch=false + ) + /*##############################################################*/ - ZCStringList& ExtractBetweenToList( ////////////////////////////// - ZCStringList& ARR_SaveList , - TypeCharC* APC_Search1Char, - TypeCharC* APC_Search2Char, - bool AB_DoIncludeSearch=false - /*/////////*/ ) const //////////////////////////////////////////// + ZCStringList& ExtractBetweenToList /*###########################*/ + ( + ZCStringList& ARR_SaveList , + TypeCharC* APC_Search1Char, + TypeCharC* APC_Search2Char, + bool AB_DoIncludeSearch=false + ) const + /*##############################################################*/ { - using ZNsMain::ZftGetLengthType ; - return ExtractBetweenToList(RR(ARR_SaveList), /////////////////////////// mpc_Data , APC_Search1Char , APC_Search2Char , ml_UseLen , - ZftGetLengthType(APC_Search1Char), - ZftGetLengthType(APC_Search2Char), + GetLength(APC_Search1Char), + GetLength(APC_Search2Char), AB_DoIncludeSearch /*/////////*/ ); //////////////////////////////////////////////////////// }/* - ZCStringList& ExtractBetweenToList( /////////////////////////////// - ZCStringList& ARR_SaveList , - TypeCharC* APC_Search1Char, - TypeCharC* APC_Search2Char, - bool AB_DoIncludeSearch=false - //////////// ) const //////////////////////////////////////////*/ + ZCStringList& ExtractBetweenToList ############################### + ( + ZCStringList& ARR_SaveList , + TypeCharC* APC_Search1Char, + TypeCharC* APC_Search2Char, + bool AB_DoIncludeSearch=false + ) const + ################################################################*/ template @@ -4831,10 +4816,10 @@ namespace ZNsMain typedef typename TypeList::TypeData ZCString; if(AL_OriginLen<1 || AL_Search1Len<1 || AL_Search2Len<1) - { - return ARR_SaveList; /*###########################*/ - }/* - if(AL_OriginLen<1 || AL_Search1Len<1 || AL_Search2Len<1)*/ + { + return ARR_SaveList; + }/* + //////////////////////////////////////////////////////*/ TypeLength VL_Pos1=0; TypeLength VL_Pos2=0; @@ -4929,16 +4914,14 @@ namespace ZNsMain bool AB_DoIncludeSearch=false /*/////////*/ ) const { - using ZNsMain::ZftGetLengthType ; - return ExtractBetweenToListType( ////////////////////////////// ARR_SaveList , mpc_Data , APC_Search1Char , APC_Search2Char , ml_UseLen , - ZftGetLengthType(APC_Search1Char), - ZftGetLengthType(APC_Search2Char), + GetLength(APC_Search1Char), + GetLength(APC_Search2Char), AB_DoIncludeSearch /*/////////*/ ); //////////////////////////////////////////////////////// }/* @@ -5379,33 +5362,38 @@ namespace ZNsMain ZCStringBase& AddPerChunk(TypeLength AL_ChunkSize, TypeCharC* APC_AddChar) { - return AddPerChunk( - AL_ChunkSize, APC_AddChar, ZNsMain::ZftGetLengthType(APC_AddChar)); + return AddPerChunk //////////////////////////// + ( + AL_ChunkSize , + APC_AddChar , + GetLength(APC_AddChar) + ); + /////////////////////////////////////////////// }/* ZCStringBase& AddPerChunk(TypeLength AL_ChunkSize, TypeCharC* APC_AddChar)*/ - bool LoadFile + bool LoadFile /*##############################################################*/ ( TypeCharC* APC_FileName , bool AB_DoAppend=true, TypeLength AL_AddAllocSize=0, TypeLength AL_LoadSize=0 ) - ///////////// + /*#############################################################################*/ { // window 에서 _open() 함수는 \r\n 을 한 문자로 입력받음에 주의. // AL_AddAllocSize 는 파일 APC_FileName 의 크기보다 더 큰 메모리가 필요할 경우에 전달한다. #ifndef _WIN - int AH_FileDesc = - ::open(APC_FileName,ZNsConst::ZNsLlioMode::Read); + int AH_FileDesc = ::open + (APC_FileName, ZNsConst::ZNsLlioMode::Read); if(AH_FileDesc == -1) return false; // 파일기술자를 파일의 맨 끝으로 이동시켜 파일크기를 구한다. - off_t VL_Offset= - ::lseek(AH_FileDesc, 0/*Offset*/, SEEK_END); // 실패시 -1 + off_t VL_Offset = ::lseek + (AH_FileDesc, 0/*Offset*/, SEEK_END); // 실패시 -1 if(VL_Offset== -1) { @@ -5413,7 +5401,8 @@ namespace ZNsMain }/* if(VL_Offset== -1)*/ - if(AL_LoadSize>0 && VL_Offset>AL_LoadSize) VL_Offset=AL_LoadSize; + if(AL_LoadSize>0 && VL_Offset>AL_LoadSize) + { VL_Offset=AL_LoadSize; } // 파일 기술자를 다시 처음으로 옮긴다. ::lseek(AH_FileDesc, 0/*Offset*/, SEEK_SET); @@ -5430,7 +5419,7 @@ namespace ZNsMain { mpc_Data[ml_UseLen=VL_PrevSize]=0; ::close(AH_FileDesc); return false; }/* - if((VL_ReadSize=read(AH_FileDesc, mpc_Data+VL_PrevSize, VL_Offset))<0)*/ + ////////////////////////////////////////////////////////////////////*/ if(VL_ReadSize>0) mpc_Data[ml_UseLen=VL_PrevSize+VL_ReadSize]=0; @@ -5473,7 +5462,7 @@ namespace ZNsMain ::CloseHandle(VH_File); if(dwRead2>0) - mpc_Data[ml_UseLen=VL_PrevSize+dwRead2]=0; + mpc_Data[ml_UseLen=VL_PrevSize+dwRead2]=0; else Invalidate(); /*else*/ @@ -5482,12 +5471,12 @@ namespace ZNsMain #endif //defined(_WIN) }/* - bool LoadFile + bool LoadFile ################################################################## ( TypeCharC* APC_FileName , bool AB_DoAppend=true, TypeLength AL_AddAllocSize=0, TypeLength AL_LoadSize=0 ) - ///////////*/ + /*#############################################################################*/ bool LoadFile ( @@ -5506,12 +5495,12 @@ namespace ZNsMain ///////////*/ - static TypeLength SearchFileOffset + static TypeLength SearchFileOffset /*##########################################*/ ( const int AH_FileDesc , TypeCharC* APC_Search, TypeLength AL_SearchLen, TypeLength AL_WantSearchCnt=1 ) - /*##############################*/ + /*#############################################################################*/ { /*/////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -5594,12 +5583,12 @@ namespace ZNsMain return CI_SearchNo; // 이때는 못 찾은 것이다 }/* - static TypeLength SearchFileOffset + static TypeLength SearchFileOffset ############################################## ( const int AH_FileDesc , TypeCharC* APC_Search, TypeLength AL_SearchLen, TypeLength AL_WantSearchCnt=1 ) - ////////////////////////////////*/ + /*#############################################################################*/ @@ -5652,7 +5641,7 @@ namespace ZNsMain { return VL_Offset+VL_FindedPos ; }/* - if(++VL_SearchCnt>=AL_WantSearchCnt)*/ + //////////////////////////////////*/ VL_InnerOffset = VL_FindedPos + AL_SearchLen ; }/* @@ -5666,7 +5655,7 @@ namespace ZNsMain VO_CStringBuff.MoveFirst( VO_CStringBuff.ml_UseLen-AL_SearchLen+1 ); }/* - if(VO_CStringBuff.ml_UseLen>=AL_SearchLen)*/ + ////////////////////////////////////////*/ }/* while(true)*/ @@ -5694,12 +5683,12 @@ namespace ZNsMain LPOVERLAPPED lpOverlapped =NULL /*/////////*/ ) ///////////////////////////////////////////////*/ { - HANDLE VH_File=::CreateFile( + HANDLE VH_File = ::CreateFile( APC_FileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if(VH_File==INVALID_HANDLE_VALUE) return -1; - TypeLength VL_Offset=SearchFileOffset( + TypeLength VL_Offset = SearchFileOffset( VH_File, APC_Search, AL_SearchLen, AL_WantSearchCnt, lpOverlapped); ::CloseHandle(VH_File); return VL_Offset; @@ -5727,7 +5716,7 @@ namespace ZNsMain if(AH_FileDesc<0) return -1; - TypeLength VL_Offset=SearchFileOffset( + TypeLength VL_Offset = SearchFileOffset( AH_FileDesc, APC_Search, AL_SearchLen, AL_WantSearchCnt); ::close(AH_FileDesc); return VL_Offset; @@ -5742,12 +5731,12 @@ namespace ZNsMain #endif //!defined(_WIN) - static TypeLength SearchFileOffsetBackward + static TypeLength SearchFileOffsetBackward /*##################################*/ ( const int AH_FileDesc , TypeCharC* APC_Search, TypeLength AL_SearchLen, TypeLength AL_WantSearchCnt=1 ) - ////////////////////////////////////////// + /*#############################################################################*/ { // SearchFileOffset() 함수와 역할은 비슷하나 뒤에서 앞으로 접근한다. @@ -5796,8 +5785,15 @@ namespace ZNsMain VL_InnerOffset=VO_CStringBuff.ml_UseLen-1; - while((VL_FindedPos=VO_CStringBuff. - FindPosFromEnd(APC_Search, AL_SearchLen, VL_InnerOffset))>=0) + while ////////////////////////////////////////////////////// + ( + ( VL_FindedPos=VO_CStringBuff.FindPosFromEnd + ( + APC_Search, AL_SearchLen, VL_InnerOffset + ) + ) >=0 + ) + //////////////////////////////////////////////////////////// { if(++VL_SearchCnt>=AL_WantSearchCnt) { return VL_Offset2+VL_FindedPos; } @@ -5808,8 +5804,7 @@ namespace ZNsMain VL_InnerOffset = VL_FindedPos ; }/* - while((VL_FindedPos=VO_CStringBuff. - FindPosFromEnd(APC_Search, AL_SearchLen, VL_InnerOffset))>=0)*/ + //////////////////////////////////////////////////////////*/ VL_Offset=VL_Offset2 ; }/* @@ -5818,12 +5813,12 @@ namespace ZNsMain return -1; // 이때는 못 찾은 것이다 }/* - static TypeLength SearchFileOffsetBackward + static TypeLength SearchFileOffsetBackward ###################################### ( const int AH_FileDesc , TypeCharC* APC_Search, TypeLength AL_SearchLen, TypeLength AL_WantSearchCnt=1 ) - ////////////////////////////////////////*/ + ###############################################################################*/ #ifdef _WIN @@ -5862,7 +5857,7 @@ namespace ZNsMain if((VL_Offset2-=VL_LoadLen)<0) VL_Offset2 = 0 ; - if(Seek(AH_File,VL_Offset2,FILE_BEGIN)<0) return -1; + if(Seek(AH_File, VL_Offset2, FILE_BEGIN)<0) return -1; const bool CB_IsFalse = ////////////////////////////// ( @@ -5902,10 +5897,6 @@ namespace ZNsMain VL_InnerOffset = VL_FindedPos ; }/* - while ( ( VL_FindedPos = VO_CStringBuff.FindPosFromEnd - ( APC_Search, AL_SearchLen, VL_InnerOffset ) - ) >= 0 - ) //////////////////////////////////////////////////////*/ VL_Offset=VL_Offset2 ; @@ -5931,17 +5922,17 @@ namespace ZNsMain { #ifndef _WIN - int AH_FileDesc = - ::open(APC_FileName, ZNsConst::ZNsLlioMode::Read); + int AH_FileDesc = ::open + (APC_FileName, ZNsConst::ZNsLlioMode::Read); if(AH_FileDesc==-1) return false; - TypeLength VL_TempOffset=::lseek( - AH_FileDesc, AL_Offset, SEEK_SET); // 실패시 -1 + TypeLength VL_TempOffset = ::lseek + (AH_FileDesc, AL_Offset, SEEK_SET); // 실패시 -1 if(VL_TempOffset==-1) return false; - bool VB_Return=ReadFile(AH_FileDesc, AL_LoadSize); + bool VB_Return = ReadFile(AH_FileDesc, AL_LoadSize); ::close(AH_FileDesc); return VB_Return; @@ -5963,7 +5954,7 @@ namespace ZNsMain ::SetFilePointer( VH_File, AL_Offset, NULL, FILE_BEGIN); - bool VB_Return=ReadFile(VH_File, AL_LoadSize); + bool VB_Return = ReadFile(VH_File, AL_LoadSize); ::CloseHandle(VH_File); return VB_Return; @@ -6032,7 +6023,7 @@ namespace ZNsMain TypeChar VC_TempChar ; TypeChar VCA_FileBuff[BUFSIZ+1]; - while((VL_ReadSize=::read(AH_FileDesc, VCA_FileBuff, BUFSIZ))>0) + while((VL_ReadSize = ::read(AH_FileDesc, VCA_FileBuff, BUFSIZ))>0) { for(i=0; i0)*/ + while((VL_ReadSize = read(AH_FileDesc, VCA_FileBuff, BUFSIZ))>0)*/ return 0; }/* @@ -6086,7 +6077,7 @@ namespace ZNsMain TypeChar VC_TempChar; TypeChar VCA_FileBuff[BUFSIZ+1]; - while((VL_ReadSize=::fread( + while((VL_ReadSize = ::fread( VCA_FileBuff, sizeof(TypeChar), BUFSIZ, AP_HFile))>0) { for(i=0; i0)*/ return 0; @@ -6216,13 +6207,15 @@ namespace ZNsMain HANDLE AH_FileHandle, TypeLength AL_ReadByte, LPOVERLAPPED lpOverlaped=NULL)*/ - TypeLength ReadFileSearch( /////////////////////////////////////// - HANDLE AH_FileHandle , - TypeCharC* APC_Search , - TypeLength AL_SearchLen , - TypeLength AL_SearchCnt , - LPOVERLAPPED lpOverlapped=NULL - /*/////////*/ ) ///////////////////////////////////////////////*/ + TypeLength ReadFileSearch /*###################################################*/ + ( + HANDLE AH_FileHandle , + TypeCharC* APC_Search , + TypeLength AL_SearchLen , + TypeLength AL_SearchCnt , + LPOVERLAPPED lpOverlapped=NULL + ) + /*#############################################################################*/ { if(AL_SearchLen<1 || AL_SearchCnt<1) return 0; @@ -6275,13 +6268,15 @@ namespace ZNsMain return 0; }/* - TypeLength ReadFileSearch( /////////////////////////////////////// - HANDLE AH_FileHandle , - TypeCharC* APC_Search , - TypeLength AL_SearchLen , - TypeLength AL_SearchCnt , - LPOVERLAPPED lpOverlapped=NULL - ///////////// ) ///////////////////////////////////////////////*/ + TypeLength ReadFileSearch ####################################################### + ( + HANDLE AH_FileHandle , + TypeCharC* APC_Search , + TypeLength AL_SearchLen , + TypeLength AL_SearchCnt , + LPOVERLAPPED lpOverlapped=NULL + ) + /*#############################################################################*/ bool WriteFile(HANDLE AH_FileHandle) const @@ -6473,14 +6468,12 @@ namespace ZNsMain TypeLength AL_StartPos=0 /*//////////*/ ) ///////////////////////////////////////////////// { - using ZNsMain::ZftGetLengthType ; - return FindPos /////////////////////////////////////////////// ( - APC_Origin , - APC_Search , - ZftGetLengthType(APC_Origin), - ZftGetLengthType(APC_Search), + APC_Origin , + APC_Search , + GetLength(APC_Origin) , + GetLength(APC_Search) , AL_StartPos ); ////////////////////////////////////////////////////////////// @@ -6505,7 +6498,7 @@ namespace ZNsMain return FindPos ////////////// ( mpc_Data , APC_Search, - ml_UseLen, ZNsMain::ZftGetLengthType + ml_UseLen, ZNsMain::ZftLengthType (APC_Search) ); ///////////////////////////// @@ -6545,13 +6538,12 @@ namespace ZNsMain TypeLength FindPosEsc( TypeCharC* APC_Search, TypeCharC* APC_Escape, TypeLength AL_StartPos=0) const { - using ZNsMain::ZftGetLengthType ; - return ZCMainChars::FindPosEsc ( - mpc_Data, APC_Search , APC_Escape, ml_UseLen, - ZftGetLengthType(APC_Search), - ZftGetLengthType(APC_Escape), AL_StartPos + mpc_Data , APC_Search, + APC_Escape, ml_UseLen , + GetLength(APC_Search) , + GetLength(APC_Escape) , AL_StartPos ); ////////////////////////////// }/* @@ -6614,9 +6606,7 @@ namespace ZNsMain { return FindPosFromEnd ( - mpc_Data, APC_Search, ml_UseLen, - ZNsMain::ZftGetLengthType - (APC_Search) + mpc_Data, APC_Search, ml_UseLen, GetLength(APC_Search) ) ; ///////////////////// }/* @@ -6694,10 +6684,7 @@ namespace ZNsMain { return FindPosType ( - APC_Origin, AR_SearchList, - ZNsMain::ZftGetLengthType - (APC_Origin), - ARRL_MatchLen + APC_Origin, AR_SearchList, GetLength(APC_Origin), ARRL_MatchLen ); ////////////////// }/* @@ -6711,14 +6698,14 @@ namespace ZNsMain template static TypeLength FindPosType(TypeCharC* APC_Origin, TList& AR_SearchList) { - using ZNsMain::ZftGetLengthType ; - - TypeLength VL_MatchLen=0; return FindPosType( /*##########################*/ - APC_Origin , - AR_SearchList , - ZftGetLengthType(APC_Origin), - RR(VL_MatchLen) - /*########*/ ); /*########################################################*/ + TypeLength VL_MatchLen=0; return FindPosType ////// + ( + APC_Origin + , AR_SearchList + , GetLength(APC_Origin) + , RR(VL_MatchLen) + ); + /////////////////////////////////////////////////// }/* template static TypeLength FindPosType(TypeCharC* APC_Origin, TList& AR_SearchList) */ @@ -6783,7 +6770,7 @@ namespace ZNsMain TypeLength GetFindCnt(TypeCharC* APC_Search) { - return GetFindCnt(APC_Search, ZNsMain::ZftGetLengthType(APC_Search)); + return GetFindCnt(APC_Search, GetLength(APC_Search)); }/* TypeLength GetFindCnt(TypeCharC* APC_Search)*/ @@ -6818,7 +6805,7 @@ namespace ZNsMain bool DoHave(TypeCharC* APC_FindChars) const { - return DoHave(APC_FindChars, ZNsMain::ZftGetLengthType(APC_FindChars)); + return DoHave(APC_FindChars, GetLength(APC_FindChars)); }/* bool DoHave(TypeCharC* APC_FindChars) const*/ @@ -6848,10 +6835,9 @@ namespace ZNsMain if((VC_CharTemp=APC_CheckChar[i])=='.') { if(i==AL_CheckLen-1) return false; + if(VB_DoHavePeriod ) return false; - if(VB_DoHavePeriod) return false; - - VB_DoHavePeriod=true; /*#######*/ + VB_DoHavePeriod=true; /*########*/ } else if(VC_CharTemp<'0' || VC_CharTemp>'9') { @@ -6867,14 +6853,11 @@ namespace ZNsMain static bool IsDigit(TypeCharC* APC_CheckChar) { - using ZNsMain::ZftGetLengthType ; - - return IsDigit + return IsDigit /////////// ( - APC_CheckChar, ZftGetLengthType - (APC_CheckChar) + APC_CheckChar, GetLength(APC_CheckChar) ); - ////////////// + ////////////////////////// }/* static bool IsDigit(TypeCharC* APC_CheckChar)*/ @@ -6911,13 +6894,14 @@ namespace ZNsMain { // mpc_Data 문자열이 APC_FindChars 로 시작하면 true; - using ZNsMain::ZftGetLengthType ; - - return DoStart( APC_Origin , ///////////////////////////////////// - APC_FindChars , - ZftGetLengthType(APC_Origin) , - ZftGetLengthType(APC_FindChars) - /*/////////*/ ); + return DoStart //////////////////////////////// + ( + APC_Origin + , APC_FindChars + , GetLength(APC_Origin ) + , GetLength(APC_FindChars) + ); + /////////////////////////////////////////////// }/* static bool DoStart(TypeCharC* APC_Origin, TypeCharC* APC_FindChars)*/ @@ -6944,8 +6928,7 @@ namespace ZNsMain { return DoStart ( - APC_FindChars, ZNsMain::ZftGetLengthType - (APC_FindChars) + APC_FindChars, GetLength(APC_FindChars) ); ////////////// }/* @@ -6968,9 +6951,7 @@ namespace ZNsMain { return ZCMainChars::DoClose ( - mpc_Data, APC_FindChars, ml_UseLen, - ZNsMain::ZftGetLengthType - (APC_FindChars) + mpc_Data, APC_FindChars, ml_UseLen, GetLength(APC_FindChars) ); /////////////////////////// }/* @@ -6993,9 +6974,7 @@ namespace ZNsMain { return ZCMainChars::DoWrap ( - mpc_Data, APC_FindChars, ml_UseLen, - ZNsMain::ZftGetLengthType - (APC_FindChars) + mpc_Data, APC_FindChars, ml_UseLen, GetLength(APC_FindChars) ); ////////////////////////// }/* @@ -7158,8 +7137,7 @@ namespace ZNsMain if(AI_LengthDec<0) { - AI_LengthDec = ZNsMain:: - ZftGetLengthType(APC_Data) ; + AI_LengthDec = GetLength(APC_Data) ; }/* if(AI_LengthDec<0)*/ @@ -7172,7 +7150,7 @@ namespace ZNsMain { if( *VPC_StartChar++ =='.' ) break; }/* - for(VL_PeriodPos=0; VL_PeriodPos(APC_Left), - ZftGetLengthType(APC_Right) + GetLength(APC_Left), + GetLength(APC_Right) ); - //////////////////////////// + //////////////////////////////// }/* static int Minus( TypeCharC* APC_Left, TypeCharC* APC_Right)*/ @@ -7378,9 +7354,7 @@ namespace ZNsMain { return Minus ( - mpc_Data, APC_Left, ml_UseLen, - ZNsMain::ZftGetLengthType - (APC_Left) + mpc_Data, APC_Left, ml_UseLen, GetLength(APC_Left) ); //////////// }/* @@ -7430,7 +7404,7 @@ namespace ZNsMain static ZCStringBase& GetDirFromPath(ZCStringBase& ARR_CStrDir, TypeCharC* APC_FullPath) { return GetDirFromPath( RR(ARR_CStrDir), - APC_FullPath, ZNsMain::ZftGetLengthType(APC_FullPath)); + APC_FullPath, GetLength(APC_FullPath)); }/* static ZCStringBase& GetDirFromPath(ZCStringBase& ARR_CStrDir, TypeCharC* APC_FullPath)*/ @@ -7444,9 +7418,7 @@ namespace ZNsMain { return GetDirFromPath ( - RR(*this), APC_FullPath, - ZNsMain::ZftGetLengthType - (APC_FullPath) + RR(*this), APC_FullPath, GetLength(APC_FullPath) ); ///////////////////// }/* @@ -7465,9 +7437,7 @@ namespace ZNsMain TypeLength AL_StartPos=FindPosFromEnd ////////////// ( - APC_FullName, ".", AL_FullNameLen, - ZNsMain::ZftGetLengthType - (".") + APC_FullName, ".", AL_FullNameLen, GetLength(".") ); //////////////////////////////////////////////////// @@ -7487,9 +7457,7 @@ namespace ZNsMain { return MinusExt ( - RR(ARR_CStrSave), APC_FullName, - ZNsMain::ZftGetLengthType - (APC_FullName) + RR(ARR_CStrSave), APC_FullName, GetLength(APC_FullName) ); /////////////// }/* @@ -7513,9 +7481,7 @@ namespace ZNsMain TypeLength AL_StartPos=FindPosFromEnd ////////// ( - mpc_Data, ".", ml_UseLen, - ZNsMain::ZftGetLengthType - (".") + mpc_Data, ".", ml_UseLen, GetLength(".") ); //////////////////////////////////////////////// @@ -7547,9 +7513,7 @@ namespace ZNsMain TypeLength AL_StartPos = FindPosFromEnd //////////// ( - APC_FullPath, ".", AL_FullPathLen, - ZNsMain::ZftGetLengthType - (".") + APC_FullPath, ".", AL_FullPathLen, GetLength(".") ); //////////////////////////////////////////////////// @@ -7575,7 +7539,7 @@ namespace ZNsMain static ZCStringBase& GetExtFromPath(ZCStringBase& ARR_CStrExt, TypeCharC* APC_FullPath) { - return GetExtFromPath(RR(ARR_CStrExt), APC_FullPath, ZNsMain::ZftGetLengthType(APC_FullPath)); + return GetExtFromPath(RR(ARR_CStrExt), APC_FullPath, GetLength(APC_FullPath)); }/* static ZCStringBase & GetExtFromPath(ZCStringBase& ARR_CStrExt, TypeCharC* APC_FullPath)*/ @@ -7587,17 +7551,17 @@ namespace ZNsMain ZCStringBase& GetExtFromPath(TypeCharC* APC_FullPath) { - return GetExtFromPath(RR(*this), APC_FullPath, ZNsMain::ZftGetLengthType(APC_FullPath)); + return GetExtFromPath(RR(*this), APC_FullPath, GetLength(APC_FullPath)); }/* ZCStringBase& GetExtFromPath(TypeCharC* APC_FullPath)*/ - static void SplitPath + static void SplitPath /*#######################################################*/ ( ZCStringBase& ARR_CStrNoExt, ZCStringBase& ARR_CStrExt , TypeCharC* APC_FullPath , TypeLength AL_FullPathLen ) - /*#################*/ + /*#############################################################################*/ { /* APC_FullPath 를 마침표를 구분자로 하여 확장자를 제외한 부분은 ARR_CStrNoExt 에, 확장자는 ARR_CStrExt 에 전달한다. */ @@ -7606,9 +7570,7 @@ namespace ZNsMain TypeLength AL_StartPos = FindPosFromEnd //////// ( - APC_FullPath, ".", AL_FullPathLen, - ZNsMain::ZftGetLengthType - (".") + APC_FullPath, ".", AL_FullPathLen, GetLength(".") ); //////////////////////////////////////////////// @@ -7625,23 +7587,20 @@ namespace ZNsMain }/* else*/ }/* - static void SplitPath + static void SplitPath ########################################################### ( ZCStringBase& ARR_CStrNoExt, ZCStringBase& ARR_CStrExt, TypeCharC* APC_FullPath , TypeLength AL_FullPathLen ) - ###################*/ + /*#############################################################################*/ static void SplitPath( ZCStringBase& ARR_CStrNoExt, ZCStringBase& ARR_CStrExt, TypeCharC* APC_FullPath) { - using ZNsMain::ZftGetLengthType ; - SplitPath /////////////////////////////////////////////////// ( RR(ARR_CStrNoExt), RR(ARR_CStrExt), - APC_FullPath , ZftGetLengthType - (APC_FullPath) + APC_FullPath , GetLength(APC_FullPath) ); ///////////////////////////////////////////////////////////// }/* @@ -7678,8 +7637,11 @@ namespace ZNsMain #ifdef _WIN - static ZTypLLong Seek( - HANDLE AH_File, ZTypLLong ALL_Offset, DWORD ADW_MoveMethod=FILE_BEGIN) + static ZTypLLong Seek + ( + HANDLE AH_File, ZTypLLong ALL_Offset, DWORD ADW_MoveMethod=FILE_BEGIN + ) + ///////////////////// { /* ADW_MoveMethod : FILE_BEGIN, FILE_CURRENT, FILE_END 중 하나. @@ -7687,17 +7649,31 @@ namespace ZNsMain LARGE_INTEGER VLL_LargeInt; - VLL_LargeInt.QuadPart=ALL_Offset; - VLL_LargeInt.LowPart =SetFilePointer( - AH_File, VLL_LargeInt.LowPart, &VLL_LargeInt.HighPart, ADW_MoveMethod); + VLL_LargeInt.QuadPart=ALL_Offset ; + VLL_LargeInt.LowPart =SetFilePointer + ( + AH_File , VLL_LargeInt.LowPart, + &VLL_LargeInt.HighPart, ADW_MoveMethod + ); + ///////////////////////////////////// - const bool CB_IsError = ( - VLL_LargeInt.LowPart==INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR ); + const bool CB_IsError = //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + ( + VLL_LargeInt.LowPart == INVALID_SET_FILE_POINTER && + GetLastError() != NO_ERROR + ); + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - if(CB_IsError) VLL_LargeInt.QuadPart=-1; return VLL_LargeInt.QuadPart; + if(CB_IsError) + VLL_LargeInt.QuadPart = -1; + + return VLL_LargeInt.QuadPart ; }/* - static ZTypLLong Seek( - HANDLE AH_File, ZTypLLong ALL_Offset, DWORD ADW_MoveMethod=FILE_BEGIN)*/ + static ZTypLLong Seek + ( + HANDLE AH_File, ZTypLLong ALL_Offset, DWORD ADW_MoveMethod=FILE_BEGIN + ) + ///////////////////*/ static inline LARGE_INTEGER To_LARGE_INTEGER (__int64 ALL_Distance) @@ -7726,8 +7702,7 @@ namespace ZNsMain return ZNsMain::ZftGetCompareCode ( mpc_Data, ml_UseLen, - APC_Data, ZNsMain::ZftGetLengthType - < TypeLength, TypeChar >( APC_Data ) + APC_Data, GetLength(APC_Data) ); ///////////////////////////////// }/* @@ -7872,12 +7847,11 @@ namespace ZNsMain TypeLength Find(TypeCharC* APC_FindChars) { - return Find + return Find /////////////////////////////////// ( - APC_FindChars, ZNsMain::ZftGetLengthType - < TypeLength, TypeChar >( APC_FindChars ) + APC_FindChars, GetLength(APC_FindChars) ); - /////////// + /////////////////////////////////////////////// }/* TypeLength Find(TypeCharC* APC_FindChars)*/ @@ -7896,12 +7870,9 @@ namespace ZNsMain TypeLength FindBackward(TypeCharC* APC_FindChars) { - using ZNsMain::ZftGetLengthType ; - return FindBackward ( - APC_FindChars, ZftGetLengthType - (APC_FindChars) + APC_FindChars, GetLength(APC_FindChars) ); /////////////////// }/* @@ -8099,12 +8070,9 @@ namespace ZNsMain ZCStringEx& AddList(const TypeChar* APC_AddData) { - using ZNsMain::ZftGetLengthType ; - return AddList ( - APC_AddData, ZftGetLengthType - (APC_AddData) + APC_AddData, GetLength(APC_AddData) ); ////////////// }/* @@ -8135,12 +8103,9 @@ namespace ZNsMain ZCStringEx& AddListTail(const TypeChar* APC_AddData) { - using ZNsMain::ZftGetLengthType ; - return AddListTail ( - APC_AddData, ZftGetLengthType - (APC_AddData) + APC_AddData, GetLength(APC_AddData) ); ////////////////// }/* @@ -8216,7 +8181,7 @@ namespace ZNsMain ZCSerial& operator()(const TypeChar* APC_Data) { - return (*this)(APC_Data,ZNsMain::ZftGetLengthType(APC_Data)); + return (*this)(APC_Data, GetLength(APC_Data)); }/* ZCSerial& operator()(const TypeChar* APC_Data)*/