summaryrefslogtreecommitdiff
path: root/src/strings/rstring.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings/rstring.py')
-rw-r--r--src/strings/rstring.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/strings/rstring.py b/src/strings/rstring.py
new file mode 100644
index 0000000..f0618d6
--- /dev/null
+++ b/src/strings/rstring.py
@@ -0,0 +1,19 @@
+class RString(object):
+ ''' print a RString
+ '''
+ __slots__ = ('_value')
+ name = 'strings::RString'
+ enabled = True
+
+ def __init__(self, value):
+ self._value = value
+
+ def children(self):
+ yield 'count', self._value['owned'].dereference()['count']
+
+ def to_string(self):
+ r = self._value['owned'].dereference()
+ b = r['body']
+ b = b.cast(b.type.target().pointer())
+ d = r['size']
+ return b.lazy_string(length=d)