X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3d0666c75bc51feb1ef512578e65c06a92c71cc8..5dfab5bea026e33031d041b233c73e196469b4ac:/include/stg/module_settings.h diff --git a/include/stg/module_settings.h b/include/stg/module_settings.h index 5af5eefc..a4de4539 100644 --- a/include/stg/module_settings.h +++ b/include/stg/module_settings.h @@ -1,58 +1,64 @@ - /* - $Revision: 1.5 $ - $Date: 2010/03/04 11:49:52 $ - $Author: faust $ - */ +#pragma once -#ifndef MODULE_SETTINGS_H -#define MODULE_SETTINGS_H - -#include // strcasecmp #include #include +#include // strcasecmp + +namespace STG +{ //----------------------------------------------------------------------------- -struct PARAM_VALUE +struct ParamValue { - PARAM_VALUE() {} - PARAM_VALUE(const std::string& p, const std::vector& vs) + ParamValue() = default; + ParamValue(const std::string& p, const std::vector& vs) noexcept : param(p), value(vs) {} - PARAM_VALUE(const std::string& p, const std::vector& vs, const std::vector& ss) + ParamValue(const std::string& p, const std::vector& vs, const std::vector& ss) noexcept : param(p), value(vs), sections(ss) {} - bool operator==(const PARAM_VALUE & rhs) const - { return !strcasecmp(param.c_str(), rhs.param.c_str()); } - bool operator<(const PARAM_VALUE & rhs) const - { return strcasecmp(param.c_str(), rhs.param.c_str()) < 0; } + ParamValue(const ParamValue&) = default; + ParamValue& operator=(const ParamValue&) = default; + ParamValue(ParamValue&&) = default; + ParamValue& operator=(ParamValue&&) = default; + + bool operator==(const ParamValue & rhs) const noexcept + { return !strcasecmp(param.c_str(), rhs.param.c_str()); } + + bool operator<(const ParamValue & rhs) const noexcept + { return strcasecmp(param.c_str(), rhs.param.c_str()) < 0; } std::string param; std::vector value; - std::vector sections; + std::vector sections; }; //----------------------------------------------------------------------------- -struct MODULE_SETTINGS +struct ModuleSettings { - MODULE_SETTINGS() - : moduleName(), - moduleParams() - {} - MODULE_SETTINGS(const std::string& name, const std::vector& params) + ModuleSettings() = default; + ModuleSettings(const std::string& name, const std::vector& params) noexcept : moduleName(name), moduleParams(params) {} - bool operator==(const MODULE_SETTINGS & rhs) const - { return !strcasecmp(moduleName.c_str(), rhs.moduleName.c_str()); } - bool operator<(const MODULE_SETTINGS & rhs) const - { return strcasecmp(moduleName.c_str(), rhs.moduleName.c_str()) < 0; } + ModuleSettings(const ModuleSettings&) = default; + ModuleSettings& operator=(const ModuleSettings&) = default; + ModuleSettings(ModuleSettings&&) = default; + ModuleSettings& operator=(ModuleSettings&&) = default; + + bool operator==(const ModuleSettings & rhs) const noexcept + { return !strcasecmp(moduleName.c_str(), rhs.moduleName.c_str()); } - std::string moduleName; - std::vector moduleParams; + bool operator<(const ModuleSettings & rhs) const noexcept + { return strcasecmp(moduleName.c_str(), rhs.moduleName.c_str()) < 0; } + + std::string moduleName; + std::vector moduleParams; }; //----------------------------------------------------------------------------- -#endif + +}