cpp_template and header_template

August Hörandl august.hoerandl at gmx.at
Wed May 30 21:22:17 BST 2001


August Hörandl wrote:
 
> forgot the copy constructor - should be easy, give me some days, its
> a little busy around here

okay - here we go:
- added copy constructor
- corrected operator << and >>

Could some please apply the attached patch - thanks
Gustl

-- 
August Hörandl                         august.hoerandl at gmx.at
An NT server can be run by an idiot, and usually is.
-------------- next part --------------
--- kdevelop/kdevelop/cclonefunctiondlg.cpp.orig	Thu May 24 20:47:06 2001
+++ kdevelop/kdevelop/cclonefunctiondlg.cpp	Thu May 24 21:05:47 2001
@@ -29,6 +29,7 @@
 static const QString templates("Templates");
 
 enum templatetype {
+  c_copy,            /* copy constructor */
   c_unaer_member,    /* class operator@ () */
   c_member,          /* class operator@ (class) */
   c_bin_compare,   /* friend bool operator@ (class, class) */
@@ -42,6 +43,7 @@
   QString name;
   templatetype typ;
 } templatesdata[] = {
+ { "", c_copy },
 
  { "!",  c_unaer_member },
  { "~",  c_unaer_member },
@@ -198,6 +200,9 @@
     for(int i=0; i < templatescount; i++) {
       QString op = templatesdata[i].name;
       switch (templatesdata[i].typ) {
+        case c_copy:  /* copy constructor */
+          methods->insertItem(" "+classname + oparg1);
+          break;
         case c_unaer_member:    /* class operator@ () */
           methods->insertItem(classname + "& operator " + op + noarg);
           break;
@@ -220,11 +225,11 @@
           break;
 
         case inp:         /* oper >> */
- 	        methods->insertItem(QString("friend istream& operator << (istream& , "+ classname + "& )"));
+ 	        methods->insertItem(QString("friend istream& operator >> (istream& , "+ classname + "& )"));
           break;
 
         case outp:         /* oper << */
-       	  methods->insertItem(QString("friend ostream& operator >> (ostream& , const"+ classname + "& )"));
+       	  methods->insertItem(QString("friend ostream& operator << (ostream& , const"+ classname + "& )"));
           break;
       }
     }


More information about the KDevelop mailing list