MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / glob_path_as_string_list

Function glob_path_as_string_list

include/Helpers/StringHelpers.cpp:182–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182std::vector<std::string> glob_path_as_string_list(const std::filesystem::path& folder, const char* globStr, SDL_GlobFlags globFlags, const std::function<std::string(const std::filesystem::path)>& pathToStr) {
183 int globCount;
184 char** filesInPath = SDL_GlobDirectory(folder.string().c_str(), globStr, globFlags, &globCount);
185 if(!filesInPath)
186 throw std::runtime_error("[glob_path_as_string_list] SDL_GlobDirectory failed");
187 std::vector<std::string> toRet(globCount);
188 for(int i = 0; i < globCount; i++)
189 toRet[i] = pathToStr(std::filesystem::path(filesInPath[i]));
190 return toRet;
191}
192
193std::filesystem::path sdl_safe_copy_file(const std::filesystem::path& toPath, const std::filesystem::path& fileToCopy, const std::string& fileName, const std::string& fileExtension) {
194 std::vector<std::string> toFolderListNames;

Callers 4

autosave_to_directoryMethod · 0.85
move_selected_filesMethod · 0.85
sdl_safe_copy_fileFunction · 0.85

Calls 2

c_strMethod · 0.80
stringMethod · 0.45

Tested by

no test coverage detected