diff options
Diffstat (limited to 'louloulibs/config/config.hpp')
-rw-r--r-- | louloulibs/config/config.hpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/louloulibs/config/config.hpp b/louloulibs/config/config.hpp index 72620c0..b46768e 100644 --- a/louloulibs/config/config.hpp +++ b/louloulibs/config/config.hpp @@ -60,38 +60,34 @@ public: * Destroy the instance, forcing it to be recreated (with potentially * different parameters) the next time it’s needed. */ - static void close(); + static void clear(); /** - * Set the value of the filename to use, before calling any method. + * Read the configuration file at the given path. */ - static std::string filename; + static bool read_conf(const std::string& name=""); /** - * Set to true if you want an exception to be raised if the file does not - * exist when reading it. + * Get the filename */ - static bool file_must_exist; + static const std::string& get_filename() + { return Config::filename; } private: /** - * Get the singleton instance - */ - static std::unique_ptr<Config>& instance(); - /** - * Read the configuration file at the given path. + * Set the value of the filename to use, before calling any method. */ - bool read_conf(); + static std::string filename; /** * Write all the config values into the configuration file */ - void save_to_file() const; + static void save_to_file(); /** * Call all the callbacks previously registered using connect(). * This is used to notify any class that a configuration change occured. */ - void trigger_configuration_change(); + static void trigger_configuration_change(); - std::map<std::string, std::string> values; - std::vector<t_config_changed_callback> callbacks; + static std::map<std::string, std::string> values; + static std::vector<t_config_changed_callback> callbacks; }; |