From 88c01588aa0830e219eaa62588839e4d1e2883ce Mon Sep 17 00:00:00 2001 From: untodesu Date: Wed, 25 Jun 2025 00:44:36 +0500 Subject: Clang-format the entire source code --- core/config.hh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'core/config.hh') diff --git a/core/config.hh b/core/config.hh index ac9f08c..3df0870 100644 --- a/core/config.hh +++ b/core/config.hh @@ -5,8 +5,8 @@ class IConfigValue { public: virtual ~IConfigValue(void) = default; - virtual void set(const char *value) = 0; - virtual const char *get(void) const = 0; + virtual void set(const char* value) = 0; + virtual const char* get(void) const = 0; }; class ConfigBoolean final : public IConfigValue { @@ -14,8 +14,8 @@ public: explicit ConfigBoolean(bool default_value = false); virtual ~ConfigBoolean(void) = default; - virtual void set(const char *value) override; - virtual const char *get(void) const override; + virtual void set(const char* value) override; + virtual const char* get(void) const override; bool get_value(void) const; void set_value(bool value); @@ -25,8 +25,8 @@ private: std::string m_string; public: - static const char *to_string(bool value); - static bool from_string(const char *value); + static const char* to_string(bool value); + static bool from_string(const char* value); }; template @@ -38,8 +38,8 @@ public: explicit ConfigNumber(T default_value, T min_value, T max_value); virtual ~ConfigNumber(void) = default; - virtual void set(const char *value) override; - virtual const char *get(void) const override; + virtual void set(const char* value) override; + virtual const char* get(void) const override; T get_value(void) const; void set_value(T value); @@ -82,11 +82,11 @@ public: class ConfigString final : public IConfigValue { public: - explicit ConfigString(const char *default_value); + explicit ConfigString(const char* default_value); virtual ~ConfigString(void) = default; - virtual void set(const char *value) override; - virtual const char *get(void) const override; + virtual void set(const char* value) override; + virtual const char* get(void) const override; private: std::string m_value; @@ -98,18 +98,18 @@ public: virtual ~Config(void) = default; void load_cmdline(void); - bool load_file(const char *path); - bool save_file(const char *path) const; + bool load_file(const char* path); + bool save_file(const char* path) const; - bool set_value(const char *name, const char *value); - const char *get_value(const char *name) const; + bool set_value(const char* name, const char* value); + const char* get_value(const char* name) const; - void add_value(const char *name, IConfigValue &vref); + void add_value(const char* name, IConfigValue& vref); - const IConfigValue *find(const char *name) const; + const IConfigValue* find(const char* name) const; private: - std::unordered_map m_values; + std::unordered_map m_values; }; template @@ -131,7 +131,7 @@ inline ConfigNumber::ConfigNumber(T default_value, T min_value, T max_value) } template -inline void ConfigNumber::set(const char *value) +inline void ConfigNumber::set(const char* value) { std::istringstream(value) >> m_value; m_value = std::clamp(m_value, m_min_value, m_max_value); @@ -139,7 +139,7 @@ inline void ConfigNumber::set(const char *value) } template -inline const char *ConfigNumber::get(void) const +inline const char* ConfigNumber::get(void) const { return m_string.c_str(); } -- cgit