X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Ffileutils.h;h=9623a548daaedb44c77591d9619390527aef2bc3;hb=6e898936d6e0f44da0992ad09139f0e8e6d141af;hp=89f92f97fea2aa426c90579cb0356d9def14a1f2;hpb=87b1461e2a4710a38b32186c2582da9fe9bb3804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/fileutils.h b/include/fileutils.h index 89f92f97f..9623a548d 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -19,6 +19,10 @@ #pragma once +#ifndef _WIN32 +# include +#endif + /** Provides an easy method of reading a text file into memory. */ class CoreExport FileReader { @@ -79,6 +83,14 @@ public: */ static std::string GetFileName(const std::string& path); + /** Gets a list of files which exist in the specified directory. + * @param directory The directory to retrieve files from. + * @param entries A vector which entries will be added to. + * @param match If defined then a glob match for files to be matched against. + * @return True if the directory could be opened; otherwise false. + */ + static bool GetFileList(const std::string& directory, std::vector& entries, const std::string& match = "*"); + /** Determines whether the given path starts with a Windows drive letter. * @param path The path to validate. * @returns True if the path begins with a Windows drive letter; otherwise, false.