Changeset 635 in dev for trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp
- Timestamp:
- Jun 7, 2008, 10:57:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp
r623 r635 23 23 ////////////////////////////////////// 24 24 class CRequireFiles{ 25 char **ppFilePath; 26 int count; 25 Jenga::Common::Strings filepaths; 27 26 public: 28 CRequireFiles(){ 29 ppFilePath = (char **)malloc( 1 ); 30 count = 0; 31 } 32 ~CRequireFiles(){ 33 for( int i = 0; i < count; i++ ){ 34 free( ppFilePath[i] ); 35 } 36 free( ppFilePath ); 37 } 27 38 28 void clear(){ 39 for( int i = 0; i < count; i++ ){ 40 free( ppFilePath[i] ); 41 } 42 free( ppFilePath ); 43 44 ppFilePath = (char **)malloc( 1 ); 45 count = 0; 29 filepaths.clear(); 46 30 } 47 31 bool IsIncluded( const char *includeFilePath ){ … … 55 39 } 56 40 57 for( int i=0; i<count; i++ ){ 58 if( lstrcmpi( ppFilePath[i], tempPath ) == 0 ){ 41 BOOST_FOREACH( const std::string &filepath, filepaths ) 42 { 43 if( lstrcmpi( filepath.c_str(), tempPath ) == 0 ) 44 { 59 45 return true; 60 46 } … … 76 62 77 63 //追加 78 ppFilePath = (char **)realloc(ppFilePath, ( count + 1 ) * sizeof(char *) ); 79 ppFilePath[count] = (char *)malloc( lstrlen(tempPath) + 1 ); 80 lstrcpy( ppFilePath[count], tempPath ); 81 count++; 64 filepaths.push_back( tempPath ); 82 65 } 83 66 }; … … 116 99 add(temporary); 117 100 } 118 BOOL CDefine::add(char *name){ 119 extern HANDLE hHeap; 120 101 BOOL CDefine::add(char *name) 102 { 121 103 //重複チェック 122 104 if(check(name)) return 0; … … 535 517 } 536 518 537 void BasicSource::DirectiveIncludeOrRequire( const std::string &mainSourceFilePath, const std::string &includeDirPath ) {538 extern HANDLE hHeap; 519 void BasicSource::DirectiveIncludeOrRequire( const std::string &mainSourceFilePath, const std::string &includeDirPath ) 520 { 539 521 int i,i2,i3,sw1,LineNum,FileLayer[255],layer,LastFileByte[255]; 540 522 char temporary[MAX_PATH],temp2[MAX_PATH+255],*LayerDir[255];
Note:
See TracChangeset
for help on using the changeset viewer.