]> git.stg.codes - stg.git/blobdiff - projects/sgconf/utils.h
Port to CMake, get rid of os_int.h.
[stg.git] / projects / sgconf / utils.h
diff --git a/projects/sgconf/utils.h b/projects/sgconf/utils.h
deleted file mode 100644 (file)
index 3793c9c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef __STG_SGCONF_UTILS_H__
-#define __STG_SGCONF_UTILS_H__
-
-#include "stg/common.h"
-#include "stg/resetable.h"
-
-#include <string>
-#include <map>
-
-namespace SGCONF
-{
-
-template <typename T>
-inline
-void MaybeSet(const std::map<std::string, std::string> & options, const std::string & name, RESETABLE<T> & res)
-{
-std::map<std::string, std::string>::const_iterator it(options.find(name));
-if (it == options.end())
-    return;
-T value;
-if (str2x(it->second, value) < 0)
-    return;
-res = value;
-}
-
-template <typename T, typename F>
-inline
-void MaybeSet(const std::map<std::string, std::string> & options, const std::string & name, T & res, F conv)
-{
-std::map<std::string, std::string>::const_iterator it(options.find(name));
-if (it == options.end())
-    return;
-conv(it->second, res);
-}
-
-template <>
-inline
-void MaybeSet<std::string>(const std::map<std::string, std::string> & options, const std::string & name, RESETABLE<std::string> & res)
-{
-std::map<std::string, std::string>::const_iterator it(options.find(name));
-if (it == options.end())
-    return;
-res = it->second;
-}
-
-} // namespace SGCONF
-
-#endif