- Timestamp:
- Jul 12, 2008, 9:22:58 PM (16 years ago)
- Location:
- trunk/ab5.0/jenga
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/jenga/include/common/Directory.h
r620 r680 18 18 std::string GetFullPath( const std::string &relationPath ) const; 19 19 std::string GetRelationalPath( const std::string &fullPath ) const; 20 21 void SearchFiles( Jenga::Common::Strings &resultOfFullPath, const std::string &findStr, bool isRecuresive = false ) const; 20 22 }; 21 23 -
trunk/ab5.0/jenga/include/jenga.h
r625 r680 4 4 #include "common/BoostSerializationSupport.h" 5 5 #include "common/CmdLine.h" 6 #include "common/String.h" 6 7 #include "common/Directory.h" 7 8 #include "common/EasyToken.h" … … 12 13 #include "common/Path.h" 13 14 #include "common/SourceTemplate.h" 14 #include "common/String.h"15 15 #include "common/VectorSupporter.h" -
trunk/ab5.0/jenga/src/common/Directory.cpp
r620 r680 138 138 return temp; 139 139 } 140 141 void Directory::SearchFiles( Jenga::Common::Strings &resultOfFullPath, const std::string &findStr, bool isRecuresive ) const 142 { 143 Jenga::Common::Strings result; 144 145 WIN32_FIND_DATA wfd; 146 HANDLE hFind=FindFirstFile( ( this->path + "\\" + findStr ).c_str(), &wfd ); 147 if( hFind != INVALID_HANDLE_VALUE ) 148 { 149 do 150 { 151 if( wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) 152 { 153 // ディレクトリのとき 154 if( isRecuresive ) 155 { 156 Directory tempDir( this->path + "\\" + wfd.cFileName ); 157 tempDir.SearchFiles( resultOfFullPath, findStr, isRecuresive ); 158 } 159 } 160 else 161 { 162 //ファイルのとき 163 resultOfFullPath.push_back( this->path + "\\" + wfd.cFileName ); 164 } 165 } while( FindNextFile( hFind, &wfd ) ); 166 167 FindClose( hFind ); 168 } 169 }
Note:
See TracChangeset
for help on using the changeset viewer.