1 // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
8 namespace SchematycEd
{
10 //////////////////////////////////////////////////////////////////////////
11 void GetSubFoldersAndFileNames(const char* szFolderName
, const char* szExtension
, bool bIgnorePakFiles
, TStringVector
& subFolderNames
, TStringVector
& fileNames
)
13 CRY_ASSERT(szFolderName
);
16 string searchPath
= szFolderName
;
17 searchPath
.append("/");
18 searchPath
.append(szExtension
? szExtension
: "*.*");
20 intptr_t handle
= gEnv
->pCryPak
->FindFirst(searchPath
.c_str(), &findData
);
25 if (findData
.name
[0] != '.')
27 if (findData
.attrib
& _A_SUBDIR
)
29 bool bIgnoreSubDir
= false;
32 stack_string fileName
= gEnv
->pCryPak
->GetGameFolder();
34 fileName
.append(szFolderName
);
36 fileName
.append(findData
.name
);
37 if (GetFileAttributes(fileName
.c_str()) == INVALID_FILE_ATTRIBUTES
)
44 subFolderNames
.push_back(findData
.name
);
47 else if (!bIgnorePakFiles
|| ((findData
.attrib
& _A_IN_CRYPAK
) == 0))
49 fileNames
.push_back(findData
.name
);
52 } while (gEnv
->pCryPak
->FindNext(handle
, &findData
) >= 0);
57 } // namespace SchematycEd