glibmm r792 - in trunk: . tools/extra_defs_gen



Author: daniel
Date: Mon Mar  9 17:43:04 2009
New Revision: 792
URL: http://svn.gnome.org/viewvc/glibmm?rev=792&view=rev

Log:
* tools/extra_defs_gen/generate_extra_defs.cc (get_properties):
Replace nested double quotes in the docs string by single quotes
to ease the parsing pain of gmmproc.


Modified:
   trunk/ChangeLog
   trunk/tools/extra_defs_gen/generate_extra_defs.cc

Modified: trunk/tools/extra_defs_gen/generate_extra_defs.cc
==============================================================================
--- trunk/tools/extra_defs_gen/generate_extra_defs.cc	(original)
+++ trunk/tools/extra_defs_gen/generate_extra_defs.cc	Mon Mar  9 17:43:04 2009
@@ -21,6 +21,7 @@
 
 
 #include "generate_extra_defs.h"
+#include <algorithm>
 
 std::string get_properties(GType gtype)
 {
@@ -66,11 +67,13 @@
     if(pParamSpec)
     {
       //Name and type:
-      std::string strName = g_param_spec_get_name(pParamSpec);
-      std::string strTypeName = G_PARAM_SPEC_TYPE_NAME(pParamSpec);
-      
+      const std::string strName = g_param_spec_get_name(pParamSpec);
+      const std::string strTypeName = G_PARAM_SPEC_TYPE_NAME(pParamSpec);
+
       const gchar* pchBlurb = g_param_spec_get_blurb(pParamSpec);
-      std::string strDocs = (pchBlurb ? pchBlurb : std::string());
+      std::string strDocs = (pchBlurb) ? pchBlurb : "";
+      // Quick hack to get rid of nested double quotes:
+      std::replace(strDocs.begin(), strDocs.end(), '"', '\'');
 
       strResult += "(define-property " + strName + "\n";
       strResult += "  (of-object \"" + strObjectName + "\")\n";



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]