sdbus++: use consistent typenames for properties
Previously, the generated code was assuming C++ names, but the example
(Calculator.interface.yaml) used an arbitrary name ('integer'). This
commit defines a consistent typename scheme and validates it when
interfaces are generated.
Use English typenames from the DBus protocol in interface files
rather than the C++ name or a single-letter DBus name. Use
square-bracket ([]) to identify sub-types for containers.
Examples: 'int64', 'path', 'array[dict[string, byte]]'
Change-Id: I38abe84c9cd3d5f839968349d2d3cfa0b8796cd0
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/tools/example/net/poettering/Calculator.interface.yaml b/tools/example/net/poettering/Calculator.interface.yaml
index 2c288b6..4167c36 100644
--- a/tools/example/net/poettering/Calculator.interface.yaml
+++ b/tools/example/net/poettering/Calculator.interface.yaml
@@ -8,17 +8,17 @@
Multiplies two integers 'x' and 'y' and returns the result.
parameters:
- name: x
- type: integer
+ type: int64
description: >
The first integer to multiply.
- name: y
- type: integer
+ type: int64
description: >
The second integer to multiply.
default: 1
returns:
- name: z
- type: integer
+ type: int64
description: >
The result of (x*y).
- name: Divide
@@ -26,17 +26,17 @@
Divides two integers 'x' and 'y' and returns the result.
parameters:
- name: x
- type: integer
+ type: int64
description: >
The first integer to divide.
- name: y
- type: integer
+ type: int64
description: >
The second integer to divide.
default: 1
returns:
- name: z
- type: integer
+ type: int64
description: >
The result of (x/y).
errors:
@@ -46,7 +46,7 @@
Reset the LastResult property to zero.
properties:
- name: LastResult
- type: integer
+ type: int64
default: 0
description: >
The result of the most recent calculation.
@@ -56,7 +56,7 @@
Signal indicating the LastReset property has been set to zero by the
'Clear' method.
properties:
- - type: integer
+ - type: int64
description: >
Value of LastReset prior to Clear.