diff options
Diffstat (limited to 'src/config.cpp')
| -rw-r--r-- | src/config.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/config.cpp b/src/config.cpp index 2d1b876..1a11f0b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -19,6 +19,7 @@ namespace bot { } Configuration cfg; + DatabaseConfiguration db_cfg; std::string line; while (std::getline(ifs, line, '\n')) { @@ -37,9 +38,21 @@ namespace bot { cfg.bot_username = value; } else if (key == "bot_password") { cfg.bot_password = value; + } else if (key == "db_name") { + db_cfg.name = value; + } else if (key == "db_user") { + db_cfg.user = value; + } else if (key == "db_password") { + db_cfg.password = value; + } else if (key == "db_host") { + db_cfg.host = value; + } else if (key == "db_port") { + db_cfg.port = value; } } + cfg.database = db_cfg; + return cfg; } } |
