X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8c6fa3fbaccc22127280bf77a48fab5a3ee0716e..38f134e6a96c08fdd7d4ed07ca3550e8434d56e9:/projects/sgconf/config.h?ds=sidebyside 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