MPD  0.20.15
Public Member Functions | Data Fields
ConfigBlock Struct Reference

#include <Block.hxx>

Collaboration diagram for ConfigBlock:
[legend]

Public Member Functions

 ConfigBlock (int _line=-1)
 
 ConfigBlock (const ConfigBlock &)=delete
 
 ~ConfigBlock ()
 
ConfigBlockoperator= (const ConfigBlock &)=delete
 
bool IsNull () const noexcept
 Determine if this is a "null" instance, i.e. More...
 
gcc_pure bool IsEmpty () const noexcept
 
gcc_nonnull_all void AddBlockParam (const char *_name, const char *_value, int _line=-1)
 
gcc_nonnull_all gcc_pure const BlockParamGetBlockParam (const char *_name) const noexcept
 
gcc_pure const char * GetBlockValue (const char *name, const char *default_value=nullptr) const noexcept
 
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. More...
 
int GetBlockValue (const char *name, int default_value) const
 
unsigned GetBlockValue (const char *name, unsigned default_value) const
 
bool GetBlockValue (const char *name, bool default_value) const
 

Data Fields

ConfigBlocknext
 The next ConfigBlock with the same name. More...
 
int line
 
std::vector< BlockParamblock_params
 
bool used
 This flag is false when nobody has queried the value of this option yet. More...
 

Detailed Description

Definition at line 54 of file Block.hxx.

Constructor & Destructor Documentation

◆ ConfigBlock() [1/2]

ConfigBlock::ConfigBlock ( int  _line = -1)
inlineexplicit

Definition at line 71 of file Block.hxx.

◆ ConfigBlock() [2/2]

ConfigBlock::ConfigBlock ( const ConfigBlock )
delete

◆ ~ConfigBlock()

ConfigBlock::~ConfigBlock ( )

Member Function Documentation

◆ AddBlockParam()

gcc_nonnull_all void ConfigBlock::AddBlockParam ( const char *  _name,
const char *  _value,
int  _line = -1 
)
inline

Definition at line 95 of file Block.hxx.

◆ GetBlockParam()

gcc_nonnull_all gcc_pure const BlockParam* ConfigBlock::GetBlockParam ( const char *  _name) const
noexcept

◆ GetBlockValue() [1/4]

gcc_pure const char* ConfigBlock::GetBlockValue ( const char *  name,
const char *  default_value = nullptr 
) const
noexcept

◆ GetBlockValue() [2/4]

int ConfigBlock::GetBlockValue ( const char *  name,
int  default_value 
) const

◆ GetBlockValue() [3/4]

unsigned ConfigBlock::GetBlockValue ( const char *  name,
unsigned  default_value 
) const

◆ GetBlockValue() [4/4]

bool ConfigBlock::GetBlockValue ( const char *  name,
bool  default_value 
) const

◆ GetPath()

AllocatedPath ConfigBlock::GetPath ( const char *  name,
const char *  default_value = nullptr 
) const

Same as config_get_path(), but looks up the setting in the specified block.

Throws #std::runtime_error on error.

◆ IsEmpty()

gcc_pure bool ConfigBlock::IsEmpty ( ) const
inlinenoexcept

Definition at line 90 of file Block.hxx.

◆ IsNull()

bool ConfigBlock::IsNull ( ) const
inlinenoexcept

Determine if this is a "null" instance, i.e.

an empty object that was synthesized and not loaded from a configuration file.

Definition at line 85 of file Block.hxx.

◆ operator=()

ConfigBlock& ConfigBlock::operator= ( const ConfigBlock )
delete

Field Documentation

◆ block_params

std::vector<BlockParam> ConfigBlock::block_params

Definition at line 63 of file Block.hxx.

◆ line

int ConfigBlock::line

Definition at line 61 of file Block.hxx.

◆ next

ConfigBlock* ConfigBlock::next

The next ConfigBlock with the same name.

The destructor deletes the whole chain.

Definition at line 59 of file Block.hxx.

◆ used

bool ConfigBlock::used

This flag is false when nobody has queried the value of this option yet.

Definition at line 69 of file Block.hxx.


The documentation for this struct was generated from the following file: