]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/fileutils.h
Use IsCTCP in blockcolor for ignoring CTCPs.
[user/henk/code/inspircd.git] / include / fileutils.h
index 45865bbb0068bfe032013b7d723c468e32d68477..97ddec14929f76446c06731d0a4e7e72271448ad 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2013 Peter Powell <petpow@saberuk.com>
+ *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2013, 2019 Sadie Powell <sadie@witchery.services>
  *
  * 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
@@ -20,7 +21,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<std::string> lines;
@@ -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<std::string>& 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.