X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/6a24f530fab7ebff1617f6d3929d2fcad7ed4818..8272f5d139d947fdbe469dfd7afc3ddd6ea7a603:/projects/sgconf/config.h diff --git a/projects/sgconf/config.h b/projects/sgconf/config.h index d3659a1d..f5313ef9 100644 --- a/projects/sgconf/config.h +++ b/projects/sgconf/config.h @@ -18,28 +18,27 @@ * Author : Maxim Mamontov */ -#ifndef __STG_SGCONF_CONFIG_H__ -#define __STG_SGCONF_CONFIG_H__ +#pragma once #include "stg/common.h" -#include "stg/resetable.h" -#include "stg/os_int.h" +#include "stg/optional.h" #include +#include namespace SGCONF { struct CONFIG { - RESETABLE configFile; - RESETABLE server; - RESETABLE port; - RESETABLE localAddress; - RESETABLE localPort; - RESETABLE userName; - RESETABLE userPass; - RESETABLE showConfig; + STG::Optional configFile; + STG::Optional server; + STG::Optional port; + STG::Optional localAddress; + STG::Optional localPort; + STG::Optional userName; + STG::Optional userPass; + STG::Optional showConfig; CONFIG & operator=(const CONFIG & rhs) { @@ -70,11 +69,11 @@ struct CONFIG if (!server.empty()) res += "server: '" + server.data() + "'\n"; if (!port.empty()) - res += "port: " + x2str(port.data()) + "\n"; + res += "port: " + std::to_string(port.data()) + "\n"; if (!localAddress.empty()) res += "local address: '" + localAddress.data() + "'\n"; if (!localPort.empty()) - res += "local port: " + x2str(localPort.data()) + "\n"; + res += "local port: " + std::to_string(localPort.data()) + "\n"; if (!userName.empty()) res += "userName: '" + userName.data() + "'\n"; if (!userPass.empty()) @@ -84,5 +83,3 @@ struct CONFIG }; } // namespace SGCONF - -#endif