MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / sFindFile

Method sFindFile

Engine/source/gfx/bitmap/gBitmap.cpp:161–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161bool GBitmap::sFindFile( const Path &path, Path *outPath )
162{
163 PROFILE_SCOPE( GBitmap_sFindFile );
164
165 const String origExt( String::ToLower( path.getExtension() ) );
166
167 Path tryPath( path );
168
169 for ( U32 i = 0; i < sRegistrations.size(); i++ )
170 {
171 const Registration &reg = sRegistrations[i];
172 const Vector<String> &extensions = reg.extensions;
173
174 for ( U32 j = 0; j < extensions.size(); ++j )
175 {
176 // We've already tried this one.
177 if ( extensions[j] == origExt )
178 continue;
179
180 tryPath.setExtension( extensions[j] );
181 if ( !Torque::FS::IsFile( tryPath ) )
182 continue;
183
184 if ( outPath )
185 *outPath = tryPath;
186 return true;
187 }
188 }
189
190 return false;
191}
192
193bool GBitmap::sFindFiles( const Path &path, Vector<Path> *outFoundPaths )
194{

Callers

nothing calls this directly

Calls 5

ToLowerFunction · 0.85
IsFileFunction · 0.85
getExtensionMethod · 0.45
sizeMethod · 0.45
setExtensionMethod · 0.45

Tested by

no test coverage detected