X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/5ac9b6c2949b075cbb8d8c91dd9f603f3f8ad0a3..c02633d77cb05a5deb05440d77b12ccc5bc19b85:/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