File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
sbe-tool/src/main/java/uk/co/real_logic/sbe Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,11 @@ public class SbeTool
121121 */
122122 public static final String JAVA_GENERATE_INTERFACES = "sbe.java.generate.interfaces" ;
123123
124+ /**
125+ * Boolean system property to turn on or off collapsing of nested namespaces in generated C++ stubs. Defaults to false.
126+ */
127+ public static final String CPP_NAMESPACES_COLLAPSE = "sbe.cpp.namespaces.collapse" ;
128+
124129 /**
125130 * Package in which the generated Java interfaces will be placed.
126131 */
Original file line number Diff line number Diff line change 1717
1818import org .agrona .Verify ;
1919
20+ import uk .co .real_logic .sbe .SbeTool ;
21+
2022import java .util .*;
2123import java .util .regex .Pattern ;
2224
@@ -66,7 +68,14 @@ public Ir(
6668 this .semanticVersion = semanticVersion ;
6769 this .headerStructure = new HeaderStructure (new ArrayList <>(headerTokens ));
6870
69- this .namespaces = Pattern .compile ("\\ ." ).split (namespaceName == null ? packageName : namespaceName );
71+ if (Boolean .getBoolean (SbeTool .CPP_NAMESPACES_COLLAPSE ))
72+ {
73+ this .namespaces = new String []{ (namespaceName == null ? packageName : namespaceName ).replace ("." , "_" ) };
74+ }
75+ else
76+ {
77+ this .namespaces = Pattern .compile ("\\ ." ).split (namespaceName == null ? packageName : namespaceName );
78+ }
7079 }
7180
7281 /**
You can’t perform that action at this time.
0 commit comments