ConfigData: rename struct block_param to BlockParam
This commit is contained in:
parent
bf0ab2d44c
commit
76b7882f33
@ -25,7 +25,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
block_param::GetIntValue() const
|
||||
BlockParam::GetIntValue() const
|
||||
{
|
||||
char *endptr;
|
||||
long value2 = strtol(value.c_str(), &endptr, 0);
|
||||
@ -36,7 +36,7 @@ block_param::GetIntValue() const
|
||||
}
|
||||
|
||||
unsigned
|
||||
block_param::GetUnsignedValue() const
|
||||
BlockParam::GetUnsignedValue() const
|
||||
{
|
||||
char *endptr;
|
||||
unsigned long value2 = strtoul(value.c_str(), &endptr, 0);
|
||||
@ -47,7 +47,7 @@ block_param::GetUnsignedValue() const
|
||||
}
|
||||
|
||||
bool
|
||||
block_param::GetBoolValue() const
|
||||
BlockParam::GetBoolValue() const
|
||||
{
|
||||
bool value2;
|
||||
if (!get_bool(value.c_str(), &value2))
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
struct block_param {
|
||||
struct BlockParam {
|
||||
std::string name;
|
||||
std::string value;
|
||||
int line;
|
||||
@ -37,7 +37,7 @@ struct block_param {
|
||||
mutable bool used;
|
||||
|
||||
gcc_nonnull_all
|
||||
block_param(const char *_name, const char *_value, int _line=-1)
|
||||
BlockParam(const char *_name, const char *_value, int _line=-1)
|
||||
:name(_name), value(_value), line(_line), used(false) {}
|
||||
|
||||
gcc_pure
|
||||
|
@ -34,7 +34,7 @@ config_param::~config_param()
|
||||
delete next;
|
||||
}
|
||||
|
||||
const block_param *
|
||||
const BlockParam *
|
||||
config_param::GetBlockParam(const char *name) const
|
||||
{
|
||||
for (const auto &i : block_params) {
|
||||
@ -50,7 +50,7 @@ config_param::GetBlockParam(const char *name) const
|
||||
const char *
|
||||
config_param::GetBlockValue(const char *name, const char *default_value) const
|
||||
{
|
||||
const block_param *bp = GetBlockParam(name);
|
||||
const BlockParam *bp = GetBlockParam(name);
|
||||
if (bp == nullptr)
|
||||
return default_value;
|
||||
|
||||
@ -66,7 +66,7 @@ config_param::GetBlockPath(const char *name, const char *default_value,
|
||||
int line2 = line;
|
||||
const char *s;
|
||||
|
||||
const block_param *bp = GetBlockParam(name);
|
||||
const BlockParam *bp = GetBlockParam(name);
|
||||
if (bp != nullptr) {
|
||||
line2 = bp->line;
|
||||
s = bp->value.c_str();
|
||||
@ -94,7 +94,7 @@ config_param::GetBlockPath(const char *name, Error &error) const
|
||||
int
|
||||
config_param::GetBlockValue(const char *name, int default_value) const
|
||||
{
|
||||
const block_param *bp = GetBlockParam(name);
|
||||
const BlockParam *bp = GetBlockParam(name);
|
||||
if (bp == nullptr)
|
||||
return default_value;
|
||||
|
||||
@ -104,7 +104,7 @@ config_param::GetBlockValue(const char *name, int default_value) const
|
||||
unsigned
|
||||
config_param::GetBlockValue(const char *name, unsigned default_value) const
|
||||
{
|
||||
const block_param *bp = GetBlockParam(name);
|
||||
const BlockParam *bp = GetBlockParam(name);
|
||||
if (bp == nullptr)
|
||||
return default_value;
|
||||
|
||||
@ -115,7 +115,7 @@ gcc_pure
|
||||
bool
|
||||
config_param::GetBlockValue(const char *name, bool default_value) const
|
||||
{
|
||||
const block_param *bp = GetBlockParam(name);
|
||||
const BlockParam *bp = GetBlockParam(name);
|
||||
if (bp == nullptr)
|
||||
return default_value;
|
||||
|
||||
|
@ -42,7 +42,7 @@ struct config_param {
|
||||
|
||||
unsigned int line;
|
||||
|
||||
std::vector<block_param> block_params;
|
||||
std::vector<BlockParam> block_params;
|
||||
|
||||
/**
|
||||
* This flag is false when nobody has queried the value of
|
||||
@ -78,7 +78,7 @@ struct config_param {
|
||||
}
|
||||
|
||||
gcc_nonnull_all gcc_pure
|
||||
const block_param *GetBlockParam(const char *_name) const;
|
||||
const BlockParam *GetBlockParam(const char *_name) const;
|
||||
|
||||
gcc_pure
|
||||
const char *GetBlockValue(const char *name,
|
||||
|
@ -67,7 +67,7 @@ config_read_name_value(struct config_param *param, char *input, unsigned line,
|
||||
return false;
|
||||
}
|
||||
|
||||
const struct block_param *bp = param->GetBlockParam(name);
|
||||
const BlockParam *bp = param->GetBlockParam(name);
|
||||
if (bp != nullptr) {
|
||||
error.Format(config_file_domain,
|
||||
"\"%s\" is duplicate, first defined on line %i",
|
||||
|
Loading…
Reference in New Issue
Block a user