]> Creatis software - clitk.git/blobdiff - utilities/gengetopt/skels/group_counter.h
Sync gengetopt cmake files with rtk
[clitk.git] / utilities / gengetopt / skels / group_counter.h
diff --git a/utilities/gengetopt/skels/group_counter.h b/utilities/gengetopt/skels/group_counter.h
new file mode 100644 (file)
index 0000000..5cd8f8c
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * File automatically generated by
+ * gengen 1.3 by Lorenzo Bettini 
+ * http://www.gnu.org/software/gengen
+ */
+
+#ifndef GROUP_COUNTER_GEN_CLASS_H
+#define GROUP_COUNTER_GEN_CLASS_H
+
+#include <string>
+#include <iostream>
+
+using std::string;
+using std::ostream;
+
+class group_counter_gen_class
+{
+ protected:
+  string group_name;
+  string name;
+
+ public:
+  group_counter_gen_class()
+  {
+  }
+  
+  group_counter_gen_class(const string &_group_name, const string &_name) :
+    group_name (_group_name), name (_name)
+  {
+  }
+
+  static void
+  generate_string(const string &s, ostream &stream, unsigned int indent)
+  {
+    if (!indent || s.find('\n') == string::npos)
+      {
+        stream << s;
+        return;
+      }
+
+    string::size_type pos;
+    string::size_type start = 0;
+    string ind (indent, ' ');
+    while ( (pos=s.find('\n', start)) != string::npos)
+      {
+        stream << s.substr (start, (pos+1)-start);
+        start = pos+1;
+        if (start+1 <= s.size ())
+          stream << ind;
+      }
+    if (start+1 <= s.size ())
+      stream << s.substr (start);
+  }
+
+  void set_group_name(const string &_group_name)
+  {
+    group_name = _group_name;
+  }
+
+  void set_name(const string &_name)
+  {
+    name = _name;
+  }
+
+  void generate_group_counter(ostream &stream, unsigned int indent = 0);
+  
+};
+
+#endif // GROUP_COUNTER_GEN_CLASS_H