yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1// find-file-util.cpp 2#include "directory-util.h" 3 4#include "slang-com-helper.h" 5 6using namespace Slang ; 7 8/* static */ SlangResult DirectoryUtil ::findDirectories ( 9const Slang ::String & directoryPath , 10Slang ::List < Slang ::String >& outPaths ) 11{ 12outPaths .clear (); 13CombinePathVisitor visitor (directoryPath ,Path ::TypeFlag ::Directory ); 14SLANG_RETURN_ON_FAIL (Path ::find (directoryPath ,nullptr ,& visitor )); 15outPaths .swapWith (visitor .m_paths ); 16return SLANG_OK ; 17} 18 19/* static */ SlangResult DirectoryUtil ::findFilesMatchingPattern ( 20const Slang ::String & directoryPath , 21const char * pattern , 22Slang ::List < Slang ::String >& outPaths ) 23{ 24outPaths .clear (); 25CombinePathVisitor visitor (directoryPath ,Path ::TypeFlag ::File ); 26SLANG_RETURN_ON_FAIL (Path ::find (directoryPath ,pattern ,& visitor )); 27outPaths .swapWith (visitor .m_paths ); 28return SLANG_OK ; 29} 30 31/* static */ SlangResult DirectoryUtil ::findFiles ( 32const Slang ::String & directoryPath , 33Slang ::List < Slang ::String >& outPaths ) 34{ 35return findFilesMatchingPattern (directoryPath ,nullptr ,outPaths ); 36}