X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Ffileutils.h;h=97ddec14929f76446c06731d0a4e7e72271448ad;hb=c05f81cac83e80c7727594e3929e0709eccca689;hp=89f92f97fea2aa426c90579cb0356d9def14a1f2;hpb=0b63ccd0b5cb26883d6becb196fb98e4f95d0397;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/fileutils.h b/include/fileutils.h index 89f92f97f..97ddec149 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013 Peter Powell + * Copyright (C) 2014 Attila Molnar + * Copyright (C) 2013, 2019 Sadie Powell * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -79,6 +80,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.