File tree 3 files changed +10
-5
lines changed
com.btc.serviceidl/src/com/btc/serviceidl/generator
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import com.btc.serviceidl.idl.AbstractTypeReference
20
20
import com.btc.serviceidl.idl.AliasDeclaration
21
21
import com.btc.serviceidl.idl.EnumDeclaration
22
22
import com.btc.serviceidl.idl.ExceptionDeclaration
23
+ import com.btc.serviceidl.idl.FunctionDeclaration
23
24
import com.btc.serviceidl.idl.IDLSpecification
24
25
import com.btc.serviceidl.idl.InterfaceDeclaration
25
26
import com.btc.serviceidl.idl.ModuleDeclaration
@@ -255,4 +256,11 @@ class GeneratorUtil
255
256
// (in the generator settings?)
256
257
idl.eResource. URI . lastSegment. replace(" .idl" , " " ) + if (artifactNature == ArtifactNature . DOTNET ) " .NET" else " "
257
258
}
259
+
260
+ static def String getProtobufFunctionName (FunctionDeclaration object , ProtobufType protobufType )
261
+ {
262
+ val scopeDeterminant = object. scopeDeterminant
263
+ #[Names . plain(scopeDeterminant), protobufType. getName, Names . plain(object) + protobufType. getName]. join(" _" )
264
+ }
265
+
258
266
}
Original file line number Diff line number Diff line change @@ -50,13 +50,11 @@ class ProtobufUtil
50
50
51
51
val paramBundle = ParameterBundle . createBuilder(scopeDeterminant. moduleStack). with(ProjectType . PROTOBUF ). build
52
52
53
- // TODO this is cloned by java.ProtobufUtil(.getLocalName?)
54
53
val result = GeneratorUtil . getTransformedModuleName(paramBundle, ArtifactNature . CPP , TransformType . NAMESPACE ) +
55
54
Constants . SEPARATOR_NAMESPACE + if (object instanceof InterfaceDeclaration )
56
55
Names . plain(object) + protobufType. getName
57
56
else if (object instanceof FunctionDeclaration )
58
- Names . plain(scopeDeterminant) + " _" + protobufType. getName + " _" + Names . plain(object) +
59
- protobufType. getName
57
+ getProtobufFunctionName(object, protobufType)
60
58
else
61
59
Names . plain(object)
62
60
Original file line number Diff line number Diff line change @@ -70,8 +70,7 @@ class ProtobufUtil
70
70
val scopeDeterminant = object. scopeDeterminant
71
71
72
72
if (object instanceof FunctionDeclaration && Util . ensurePresentOrThrow(optProtobufType))
73
- Names . plain(scopeDeterminant) + " _" + optProtobufType. get. getName + " _" + Names . plain(object) +
74
- optProtobufType. get. getName
73
+ getProtobufFunctionName(object as FunctionDeclaration , optProtobufType. get)
75
74
else
76
75
(if (scopeDeterminant instanceof ModuleDeclaration )
77
76
Constants . FILE_NAME_TYPES
You can’t perform that action at this time.
0 commit comments