]> git.stg.codes - stg.git/blobdiff - projects/sgconf/makeproto.h
Fight Optional
[stg.git] / projects / sgconf / makeproto.h
diff --git a/projects/sgconf/makeproto.h b/projects/sgconf/makeproto.h
new file mode 100644 (file)
index 0000000..82100f4
--- /dev/null
@@ -0,0 +1,21 @@
+#pragma once
+
+#include "config.h"
+
+#include "stg/servconf.h"
+
+namespace SGCONF
+{
+
+inline
+STG::ServConf makeProto(const CONFIG& config)
+{
+    return STG::ServConf(config.server.value(),
+                         config.port.value(),
+                         config.localAddress.value(),
+                         config.localPort.value(),
+                         config.userName.value(),
+                         config.userPass.value());
+}
+
+}