repaired std::string handling
authorVadim Pisarevsky <vadim.pisarevsky@gmail.com>
Thu, 21 Mar 2013 07:30:38 +0000 (11:30 +0400)
committerVadim Pisarevsky <vadim.pisarevsky@gmail.com>
Thu, 21 Mar 2013 07:30:38 +0000 (11:30 +0400)
modules/python/src2/cv2.cpp
modules/python/src2/gen2.py

index bbdd5ab..59f7f15 100644 (file)
@@ -99,6 +99,8 @@ catch (const cv::Exception &e) \
 using namespace cv;
 typedef cv::softcascade::ChannelFeatureBuilder softcascade_ChannelFeatureBuilder;
 
+typedef std::string string;
+
 typedef std::vector<uchar> vector_uchar;
 typedef std::vector<int> vector_int;
 typedef std::vector<float> vector_float;
index c7aa725..8669fbd 100755 (executable)
@@ -214,8 +214,7 @@ simple_argtype_mapping = {
     "int": ("int", "i", "0"),
     "float": ("float", "f", "0.f"),
     "double": ("double", "d", "0"),
-    "c_string": ("char*", "s", '(char*)""'),
-    "string": ("std::string", "s", None)
+    "c_string": ("char*", "s", '(char*)""')
 }
 
 def normalize_class_name(name):
@@ -571,7 +570,7 @@ class FuncInfo(object):
             else:
                 code_fcall = "ERRWRAP2( "
                 if v.rettype:
-                    code_decl += "    " + simple_argtype_mapping.get(v.rettype, (v.rettype, None, None))[0]  + " retval;\n"
+                    code_decl += "    " + v.rettype + " retval;\n"
                     code_fcall += "retval = "
                 if ismethod:
                     code_fcall += "_self_->" + self.cname