aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-05-23 17:42:08 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-07-03 16:08:55 +0200
commitb9beb566171a7024b32e1d76477580171dec3929 (patch)
tree42497127b96dc12c258e079fe514084237897e2d /build-aux
parentdba61b453444af7093e07538e4d8b1b07ab387ad (diff)
qmi-codegen: include string TLV contents in printable strings
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/qmi-codegen/FieldString.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/build-aux/qmi-codegen/FieldString.py b/build-aux/qmi-codegen/FieldString.py
index 455741f..5b86298 100644
--- a/build-aux/qmi-codegen/FieldString.py
+++ b/build-aux/qmi-codegen/FieldString.py
@@ -87,3 +87,25 @@ class FieldString(Field):
template += (
'${lp}}\n')
f.write(string.Template(template).substitute(translations))
+
+
+ def emit_output_tlv_get_printable(self, f):
+ translations = { 'underscore' : utils.build_underscore_name (self.fullname),
+ 'tlv_id' : self.id_enum_name }
+
+ template = (
+ '\n'
+ 'static gchar *\n'
+ '${underscore}_get_printable (\n'
+ ' QmiMessage *self)\n'
+ '{\n'
+ ' gchar *printable;\n'
+ '\n'
+ ' printable = qmi_message_tlv_get_string (self,\n'
+ ' ${tlv_id},\n'
+ ' NULL);\n'
+ ' g_assert (printable != NULL);'
+ '\n'
+ ' return printable;\n'
+ '}\n')
+ f.write(string.Template(template).substitute(translations))