20 #ifndef MPD_CONFIG_BLOCK_HXX
21 #define MPD_CONFIG_BLOCK_HXX
44 BlockParam(
const char *_name,
const char *_value,
int _line=-1)
45 :name(_name), value(_value), line(_line), used(false) {}
72 :next(nullptr), line(_line), used(false) {}
91 return block_params.empty();
97 block_params.emplace_back(_name, _value, _line);
105 const char *default_value=
nullptr) const noexcept;
114 const
char *default_value=
nullptr) const;
116 int GetBlockValue(const
char *name,
int default_value) const;
118 unsigned GetBlockValue(const
char *name,
unsigned default_value) const;
120 bool GetBlockValue(const
char *name,
bool default_value) const;
A path name in the native file system character set.
gcc_nonnull_all BlockParam(const char *_name, const char *_value, int _line=-1)
ConfigBlock * next
The next ConfigBlock with the same name.
bool GetBoolValue() const
AllocatedPath GetPath(const char *name, const char *default_value=nullptr) const
Same as config_get_path(), but looks up the setting in the specified block.
gcc_nonnull_all void AddBlockParam(const char *_name, const char *_value, int _line=-1)
bool used
This flag is false when nobody has queried the value of this option yet.
gcc_pure const char * GetBlockValue(const char *name, const char *default_value=nullptr) const noexcept
gcc_pure bool IsEmpty() const noexcept
ConfigBlock & operator=(const ConfigBlock &)=delete
ConfigBlock(int _line=-1)
bool used
This flag is false when nobody has queried the value of this option yet.
unsigned GetUnsignedValue() const
gcc_nonnull_all gcc_pure const BlockParam * GetBlockParam(const char *_name) const noexcept
bool IsNull() const noexcept
Determine if this is a "null" instance, i.e.
std::vector< BlockParam > block_params
const Partition const char * name