X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=include%2Ffileutils.h;h=e50cc8c34e0738539ffbb54501073e5ca04dc557;hb=9982ec4e5b027ed24b1fda5e6fd3ab35b98de1a7;hp=45865bbb0068bfe032013b7d723c468e32d68477;hpb=575a3126834d3f283f6296e33c8bce94ee7a0f59;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/fileutils.h b/include/fileutils.h index 45865bbb0..e50cc8c34 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -20,7 +20,7 @@ #pragma once /** Provides an easy method of reading a text file into memory. */ -class CoreExport FileReader : public classbase +class CoreExport FileReader { /** The lines of text in the file. */ std::vector lines; @@ -79,6 +79,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.