messy client<->server checkpoint
This commit is contained in:
31
client/src/config/ClientConfig.hpp
Normal file
31
client/src/config/ClientConfig.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/config/IConfig.hpp"
|
||||
|
||||
struct ClientParams {
|
||||
std::string id;
|
||||
|
||||
std::string hostname;
|
||||
uint32_t port;
|
||||
};
|
||||
|
||||
class ClientConfig : public IConfig<ClientParams> {
|
||||
|
||||
public:
|
||||
|
||||
using IConfig<ClientParams>::IConfig;
|
||||
|
||||
bool parseConfig(const libconfig::Setting& setting) override {
|
||||
|
||||
if (!setting.lookupValue("Id", params_->id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setting.lookupValue("Hostname", params_->hostname);
|
||||
setting.lookupValue("Port", params_->port);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user