diff --git a/include/transport/config.h b/include/transport/config.h index d6900d304d29afa1689b551ec1c789b2d614f149..4ff5b8fa079f1470b405ebffa8a072a6031d4f66 100644 --- a/include/transport/config.h +++ b/include/transport/config.h @@ -34,6 +34,7 @@ #define CONFIG_BOOL(PTR, KEY) (*PTR)[KEY].as() #define CONFIG_LIST(PTR, KEY) (*PTR)[KEY].as >() #define CONFIG_VECTOR(PTR, KEY) (*PTR)[KEY].as >() +#define CONFIG_HAS_KEY(PTR, KEY) (*PTR).hasKey(KEY) namespace Transport { @@ -75,6 +76,10 @@ class Config { bool reload(); + bool hasKey(const std::string &key) { + return m_variables.find(key) != m_variables.end(); + } + /// Returns value of variable defined by key. /// For variables in sections you can use "section.variable" key format.