config/Param: split block-specific attributes to new struct ConfigBlock

The old struct config_param remains only for top-level string options.
This commit is contained in:
Max Kellermann
2015-01-21 22:13:44 +01:00
parent 84e74173de
commit 4fa5538e2b
114 changed files with 871 additions and 732 deletions

View File

@@ -28,6 +28,7 @@
#include "db/PlaylistVector.hxx"
#include "config/ConfigGlobal.hxx"
#include "config/Param.hxx"
#include "config/Block.hxx"
#include "tag/TagConfig.hxx"
#include "fs/Path.hxx"
#include "event/Loop.hxx"
@@ -121,12 +122,12 @@ main(int argc, char **argv)
/* do it */
const auto *path = config_get_param(ConfigOption::DB_FILE);
config_param param("database", path != nullptr ? path->line : -1);
ConfigBlock block(path != nullptr ? path->line : -1);
if (path != nullptr)
param.AddBlockParam("path", path->value.c_str(), path->line);
block.AddBlockParam("path", path->value.c_str(), path->line);
Database *db = plugin->create(event_loop, database_listener,
param, error);
block, error);
if (db == nullptr) {
cerr << error.GetMessage() << endl;