Python: document writer.StringFieldDeclaration
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Dec 2014 09:17:40 +0000 (04:17 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 17 Feb 2015 21:09:26 +0000 (16:09 -0500)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
bindings/python/writer.py

index e24631d464321acd3f10e9fc8b761c1188d20cdc..0f57788ea73b9b932350fa401b6fdb9935232dda 100644 (file)
@@ -1064,9 +1064,15 @@ class SequenceFieldDeclaration(FieldDeclaration):
 
 
 class StringFieldDeclaration(FieldDeclaration):
+    """
+    String (NULL-terminated array of bytes) field declaration.
+    """
+
     def __init__(self):
         """
-        Create a new string field declaration.
+        Creates a string field declaration.
+
+        :exc:`ValueError` is raised on error.
         """
 
         self._ft = nbt._bt_ctf_field_type_string_create()
@@ -1075,17 +1081,18 @@ class StringFieldDeclaration(FieldDeclaration):
     @property
     def encoding(self):
         """
-        Get a string declaration's encoding (a constant from the CTFStringEncoding class).
+        String encoding (one of
+        :class:`babeltrace.common.CTFStringEncoding` constants).
+
+        Set this attribute to change this string's encoding.
+
+        :exc:`ValueError` is raised on error.
         """
 
         return nbt._bt_ctf_field_type_string_get_encoding(self._ft)
 
     @encoding.setter
     def encoding(self, encoding):
-        """
-        Set a string declaration's encoding. Must be a constant from the CTFStringEncoding class.
-        """
-
         ret = nbt._bt_ctf_field_type_string_set_encoding(self._ft, encoding)
         if ret < 0:
             raise ValueError("Could not set string encoding.")
This page took 0.026762 seconds and 4 git commands to generate.