diff options
Diffstat (limited to 'src/common/Configuration/Config.h')
| -rw-r--r-- | src/common/Configuration/Config.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/common/Configuration/Config.h b/src/common/Configuration/Config.h index ccb35132dd..16d522f7d6 100644 --- a/src/common/Configuration/Config.h +++ b/src/common/Configuration/Config.h @@ -1,14 +1,14 @@ /* * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by the - * Free Software Foundation; either version 3 of the License, or (at your - * option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along @@ -18,10 +18,29 @@ #ifndef CONFIG_H #define CONFIG_H +#include <cstdint> #include <stdexcept> #include <string_view> #include <vector> +enum class ConfigSeverity : uint8_t +{ + Skip, + Warn, + Error, + Fatal +}; + +struct ConfigPolicy +{ + ConfigSeverity defaultSeverity = ConfigSeverity::Warn; + ConfigSeverity missingFileSeverity = ConfigSeverity::Error; + ConfigSeverity missingOptionSeverity = ConfigSeverity::Warn; + ConfigSeverity criticalOptionSeverity = ConfigSeverity::Fatal; + ConfigSeverity unknownOptionSeverity = ConfigSeverity::Error; + ConfigSeverity valueErrorSeverity = ConfigSeverity::Error; +}; + class ConfigMgr { ConfigMgr() = default; @@ -32,7 +51,7 @@ class ConfigMgr public: bool LoadAppConfigs(bool isReload = false); bool LoadModulesConfigs(bool isReload = false, bool isNeedPrintInfo = true); - void Configure(std::string const& initFileName, std::vector<std::string> args, std::string_view modulesConfigList = {}); + void Configure(std::string const& initFileName, std::vector<std::string> args, std::string_view modulesConfigList = {}, ConfigPolicy policy = {}); static ConfigMgr* instance(); |
