Go to the documentation of this file.
43 const std::string & key,
44 const std::vector<T> & defaultVec)
46 if(!config.
has(key)) {
return defaultVec; }
47 const auto & c = config(key);
51 std::vector<T> vec = c;
60 return std::vector<T>(1, elem);
81 const auto & c = config(key);
97 auto msg = fmt::format(
"Configuration {} is not valid. It should be a vector or single element.", key);
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
void silence() const noexcept
void critical(Args &&... args)
Definition: logging.h:57
bool has(const std::string &key) const
Check if the key is part of the conf.
Exception thrown by this class when something bad occurs.
Definition: Configuration.h:223
#define MC_RTC_UTILS_DLLAPI
Definition: utils_api.h:50
std::vector< T > fromVectorOrElement(const mc_rtc::Configuration &config, const std::string &key, const std::vector< T > &defaultVec)
Definition: ConfigurationHelpers.h:42