[mapguide-commits] r10192 - branches/4.0/MgDev/Bindings/src/IMake

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Sep 12 04:11:29 PDT 2025


Author: jng
Date: 2025-09-12 04:11:27 -0700 (Fri, 12 Sep 2025)
New Revision: 10192

Modified:
   branches/4.0/MgDev/Bindings/src/IMake/IMake.cpp
Log:
Fix cases where converted doxygen docs did not get attached to its C#/Java proxy method due to [cs/js]methodmodifiers being const-sensitive and us not capturing the const qualifier if present.

Modified: branches/4.0/MgDev/Bindings/src/IMake/IMake.cpp
===================================================================
--- branches/4.0/MgDev/Bindings/src/IMake/IMake.cpp	2025-09-12 10:11:46 UTC (rev 10191)
+++ branches/4.0/MgDev/Bindings/src/IMake/IMake.cpp	2025-09-12 11:11:27 UTC (rev 10192)
@@ -14,7 +14,7 @@
     java
 };
 
-static char version[] = "1.6.1";
+static char version[] = "1.6.2";
 static char EXTERNAL_API_DOCUMENTATION[] = "(NOTE: This API is not officially supported and may be subject to removal in a future release without warning. Use with caution.)";
 
 static string module;
@@ -660,7 +660,7 @@
             //Collect the characters in the MapGuide class name
             for (size_t j = idx; j < elems[i].length(); j++) {
                 if (!isalnum(elems[i][j])) {
-                    cont = j;
+                    cont = static_cast<int>(j);
                     break;
                 } else {
                     mgClassName += elems[i][j];
@@ -721,7 +721,7 @@
             //Collect the characters in the MapGuide class name
             for (size_t j = idx; j < elems[i].length(); j++) {
                 if (!isalnum(elems[i][j])) {
-                    cont = j;
+                    cont = static_cast<int>(j);
                     break;
                 } else {
                     mgClassName += elems[i][j];
@@ -1207,6 +1207,7 @@
         elems.push_back(item);
     }
     std::string methodName;
+    bool isConst = false;
     for (size_t i = 0; i < elems.size(); i++) {
         if (elems[i] == "" || elems[i] == "virtual")
             continue;
@@ -1217,16 +1218,37 @@
             methodName += elems[i];
             size_t j = i;
             //Process parameters between the ( and )
+            bool bPastLastParen = false;
             while(j < elems.size()) {
                 j++;
-                if (elems[j] != ")") {
-                    methodName += " ";
-                    methodName += elems[j];
-                } else {
-                    methodName += " ";
-                    methodName += elems[j];
-                    break;
+                if (bPastLastParen)
+                {
+                    // We're not appending to methodName at this point. We are only
+                    // checking if the const qualifier is present
+                    //
+                    // [cs/js]methodmodifiers is const-sensitive on method signatures
+                    // so we must include it here if present for the relevant modifiers/docs
+                    // to attach properly
+                    if (elems[j] == "const")
+                        isConst = true;
                 }
+                else
+                {
+                    if (elems[j] != ")") {
+                        // This has to be a ( void ), nothing in the public MapGuide API
+                        // surface takes void pointers. So if this token is void, skip it
+                        if (elems[j] == "void") {
+                            continue;
+                        }
+                        methodName += " ";
+                        methodName += elems[j];
+                    }
+                    else {
+                        methodName += " ";
+                        methodName += elems[j];
+                        bPastLastParen = true;
+                    }
+                }
             }
             break;
         }
@@ -1236,6 +1258,8 @@
         return;
 
     swigMethodDecl += methodName;
+    if (isConst)
+        swigMethodDecl += " const";
 
     if (language == java) {
         convertedDoc = doxygenToJavaDoc(commentStr, isPublished);



More information about the mapguide-commits mailing list