mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Allow overriding path separator to list generated by 'RecursiveFindFilesMatchingName'
This commit is contained in:
parent
248efc114b
commit
4e8b27a1e9
@ -24,7 +24,7 @@ void ComputeModFilename( const char *pContentFileName, char *pBuf, size_t nBufLe
|
||||
void ComputeModContentFilename( const char *pGameFileName, char *pBuf, size_t nBufLen );
|
||||
|
||||
// Finds all files matching the a name within a directory and its sub directories. Output entries are paths to found files (relative to and including szStartDirectory).
|
||||
void RecursiveFindFilesMatchingName( CUtlVector< CUtlString > *pOutFileList, const char* szStartDirectory, const char* szTargetFileName, const char *pPathID );
|
||||
void RecursiveFindFilesMatchingName( CUtlVector< CUtlString > *pOutFileList, const char* szStartDirectory, const char* szTargetFileName, const char *pPathID, char separator = CORRECT_PATH_SEPARATOR);
|
||||
|
||||
// Builds a list of all files under a directory with a particular extension.
|
||||
void AddFilesToList( CUtlVector< CUtlString > &list, const char *pDirectory, const char *pPath = nullptr, const char *pExtension = nullptr );
|
||||
|
@ -113,7 +113,7 @@ void ComputeModContentFilename( const char *pGameFileName, char *pBuf, size_t nB
|
||||
// *szTargetFileName -
|
||||
// *pathID -
|
||||
//-----------------------------------------------------------------------------
|
||||
void RecursiveFindFilesMatchingName( CUtlVector< CUtlString > *pOutFileList, const char* szStartDirectory, const char* szTargetFileName, const char *pPathID )
|
||||
void RecursiveFindFilesMatchingName( CUtlVector< CUtlString > *pOutFileList, const char* szStartDirectory, const char* szTargetFileName, const char *pPathID, char separator )
|
||||
{
|
||||
char searchString[MAX_PATH];
|
||||
Q_snprintf( searchString, sizeof( searchString ), "%s/*.*", szStartDirectory );
|
||||
@ -127,13 +127,13 @@ void RecursiveFindFilesMatchingName( CUtlVector< CUtlString > *pOutFileList, con
|
||||
{
|
||||
char newSearchPath[MAX_PATH];
|
||||
Q_snprintf( newSearchPath, sizeof( newSearchPath ), "%s/%s", szStartDirectory, curFile );
|
||||
RecursiveFindFilesMatchingName( pOutFileList, newSearchPath, szTargetFileName, pPathID );
|
||||
RecursiveFindFilesMatchingName( pOutFileList, newSearchPath, szTargetFileName, pPathID, separator);
|
||||
}
|
||||
else if ( V_StringMatchesPattern( curFile, szTargetFileName ) )
|
||||
{
|
||||
CUtlString outFile;
|
||||
outFile.Format( "%s/%s", szStartDirectory, curFile );
|
||||
V_FixSlashes( outFile.Get() );
|
||||
V_FixSlashes( outFile.Get(), separator );
|
||||
pOutFileList->AddToTail( outFile );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user