X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/0d5bff91a33dc190351adc0010f8218c81423799..51998949e60e2a7e86e4393b315cfb76a58ca80d:/projects/sgconf/config.h?ds=inline 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