]> git.stg.codes - stg.git/blobdiff - projects/sgconf/action.h
Implemented command line options parsing.
[stg.git] / projects / sgconf / action.h
index 469d746030b953860f51ac9119910bf1c90779c6..64d7c1e83e01ed6aceb653bde460c4157d182422 100644 (file)
@@ -35,6 +35,7 @@ class ACTION
     public:
         virtual ~ACTION() {}
 
+        virtual ACTION * Clone() const = 0;
         virtual std::string ParamDescription() const = 0;
         virtual std::string DefaultDescription() const = 0;
         virtual OPTION_BLOCK & Suboptions() = 0;
@@ -48,6 +49,13 @@ class ACTION
         };
 };
 
+template <typename T>
+class ACTION_CLONE_MIXIN : public ACTION
+{
+    public:
+        virtual ACTION * Clone() const { return new T(*this); }
+};
+
 } // namespace SGCONF
 
 #endif