Method
find
Source from the content-addressed store, hash-verified
| 104 | } |
| 105 | |
| 106 | boost::filesystem::path SearchPath::find( const boost::filesystem::path &file ) const |
| 107 | { |
| 108 | // if it's a full path then there's no need to do any searching |
| 109 | if( file.is_absolute() ) |
| 110 | { |
| 111 | if( exists( file ) ) |
| 112 | { |
| 113 | return file; |
| 114 | } |
| 115 | else |
| 116 | { |
| 117 | return ""; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | // do some searching |
| 122 | for( list<path>::const_iterator it = paths.begin(); it!=paths.end(); it++ ) |
| 123 | { |
| 124 | path f = *it / file; |
| 125 | if( exists( f ) ) |
| 126 | { |
| 127 | return f; |
| 128 | } |
| 129 | } |
| 130 | return ""; |
| 131 | } |