config/Block: rename GetBlockPath() to GetPath()

This commit is contained in:
Max Kellermann 2016-10-28 23:07:26 +02:00
parent f6f2a3b366
commit d8bcdca55a
7 changed files with 15 additions and 15 deletions

View File

@ -91,8 +91,8 @@ ConfigBlock::GetBlockValue(const char *name, const char *default_value) const
} }
AllocatedPath AllocatedPath
ConfigBlock::GetBlockPath(const char *name, const char *default_value, ConfigBlock::GetPath(const char *name, const char *default_value,
Error &error) const Error &error) const
{ {
assert(!error.IsDefined()); assert(!error.IsDefined());
@ -119,9 +119,9 @@ ConfigBlock::GetBlockPath(const char *name, const char *default_value,
} }
AllocatedPath AllocatedPath
ConfigBlock::GetBlockPath(const char *name, Error &error) const ConfigBlock::GetPath(const char *name, Error &error) const
{ {
return GetBlockPath(name, nullptr, error); return GetPath(name, nullptr, error);
} }
int int

View File

@ -112,10 +112,10 @@ struct ConfigBlock {
* Same as config_get_path(), but looks up the setting in the * Same as config_get_path(), but looks up the setting in the
* specified block. * specified block.
*/ */
AllocatedPath GetBlockPath(const char *name, const char *default_value, AllocatedPath GetPath(const char *name, const char *default_value,
Error &error) const; Error &error) const;
AllocatedPath GetBlockPath(const char *name, Error &error) const; AllocatedPath GetPath(const char *name, Error &error) const;
gcc_pure gcc_pure
int GetBlockValue(const char *name, int default_value) const; int GetBlockValue(const char *name, int default_value) const;

View File

@ -92,7 +92,7 @@ SimpleDatabase::Create(gcc_unused EventLoop &loop,
bool bool
SimpleDatabase::Configure(const ConfigBlock &block, Error &error) SimpleDatabase::Configure(const ConfigBlock &block, Error &error)
{ {
path = block.GetBlockPath("path", error); path = block.GetPath("path", error);
if (path.IsNull()) { if (path.IsNull()) {
if (!error.IsDefined()) if (!error.IsDefined())
error.Set(simple_db_domain, error.Set(simple_db_domain,
@ -102,7 +102,7 @@ SimpleDatabase::Configure(const ConfigBlock &block, Error &error)
path_utf8 = path.ToUTF8(); path_utf8 = path.ToUTF8();
cache_path = block.GetBlockPath("cache_directory", error); cache_path = block.GetPath("cache_directory", error);
if (path.IsNull() && error.IsDefined()) if (path.IsNull() && error.IsDefined())
return false; return false;

View File

@ -86,7 +86,7 @@ sidplay_init(const ConfigBlock &block)
{ {
/* read the songlengths database file */ /* read the songlengths database file */
Error error; Error error;
const auto database_path = block.GetBlockPath("songlength_database", error); const auto database_path = block.GetPath("songlength_database", error);
if (!database_path.IsNull()) if (!database_path.IsNull())
songlength_database = sidplay_load_songlength_db(database_path); songlength_database = sidplay_load_songlength_db(database_path);
else if (error.IsDefined()) else if (error.IsDefined())

View File

@ -42,9 +42,9 @@ wildmidi_init(const ConfigBlock &block)
{ {
Error error; Error error;
const AllocatedPath path = const AllocatedPath path =
block.GetBlockPath("config_file", block.GetPath("config_file",
"/etc/timidity/timidity.cfg", "/etc/timidity/timidity.cfg",
error); error);
if (path.IsNull()) if (path.IsNull())
FatalError(error); FatalError(error);

View File

@ -183,7 +183,7 @@ FifoOutput::Create(const ConfigBlock &block, Error &error)
{ {
FifoOutput *fd = new FifoOutput(); FifoOutput *fd = new FifoOutput();
fd->path = block.GetBlockPath("path", error); fd->path = block.GetPath("path", error);
if (fd->path.IsNull()) { if (fd->path.IsNull()) {
delete fd; delete fd;

View File

@ -128,7 +128,7 @@ RecorderOutput::Configure(const ConfigBlock &block, Error &error)
return false; return false;
} }
path = block.GetBlockPath("path", error); path = block.GetPath("path", error);
if (error.IsDefined()) if (error.IsDefined())
return false; return false;