]> git.stg.codes - stg.git/blobdiff - include/stg/module_settings.h
Headers moved to subdir stg
[stg.git] / include / stg / module_settings.h
diff --git a/include/stg/module_settings.h b/include/stg/module_settings.h
new file mode 100644 (file)
index 0000000..a1baf33
--- /dev/null
@@ -0,0 +1,51 @@
+ /*
+ $Revision: 1.5 $
+ $Date: 2010/03/04 11:49:52 $
+ $Author: faust $
+ */
+
+#ifndef MODULE_SETTINGS_H
+#define MODULE_SETTINGS_H
+
+#include <cstring> // strcasecmp
+#include <string>
+#include <vector>
+
+//-----------------------------------------------------------------------------
+struct PARAM_VALUE
+{
+    PARAM_VALUE()
+        : param(),
+          value()
+    {}
+    bool operator==(const PARAM_VALUE & rhs) const
+        { return !strcasecmp(param.c_str(), rhs.param.c_str()); }
+
+    bool operator<(const PARAM_VALUE & rhs) const
+        { return strcasecmp(param.c_str(), rhs.param.c_str()) < 0; }
+
+    std::string param;
+    std::vector<std::string> value;
+};
+//-----------------------------------------------------------------------------
+struct MODULE_SETTINGS
+{
+    MODULE_SETTINGS()
+        : moduleName(),
+          moduleParams()
+    {}
+    MODULE_SETTINGS(const MODULE_SETTINGS & rvalue)
+        : moduleName(rvalue.moduleName),
+          moduleParams(rvalue.moduleParams)
+    {}
+    bool operator==(const MODULE_SETTINGS & rhs) const
+        { return !strcasecmp(moduleName.c_str(), rhs.moduleName.c_str()); }
+
+    bool operator<(const MODULE_SETTINGS & rhs) const
+        { return strcasecmp(moduleName.c_str(), rhs.moduleName.c_str()) < 0; }
+
+    std::string              moduleName;
+    std::vector<PARAM_VALUE> moduleParams;
+};
+//-----------------------------------------------------------------------------
+#endif