aboutsummaryrefslogtreecommitdiff
path: root/qobject/qstring.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2013-03-25 13:46:37 -0400
committerLuiz Capitulino <lcapitulino@redhat.com>2013-04-05 08:42:29 -0400
commit54d49ac99227aff646ac940abfab3417f5cb1693 (patch)
tree40a11bfc790f15e3ca4879b638c537f2f3a05cde /qobject/qstring.c
parentd05ef160453e98546a4197496dc8a3cb2defac53 (diff)
downloadqemu-54d49ac99227aff646ac940abfab3417f5cb1693.zip
qemu-54d49ac99227aff646ac940abfab3417f5cb1693.tar.gz
qemu-54d49ac99227aff646ac940abfab3417f5cb1693.tar.bz2
qstring: add qstring_get_length()
Long overdue. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'qobject/qstring.c')
-rw-r--r--qobject/qstring.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/qobject/qstring.c b/qobject/qstring.c
index 5f7376c..607b7a1 100644
--- a/qobject/qstring.c
+++ b/qobject/qstring.c
@@ -32,6 +32,14 @@ QString *qstring_new(void)
}
/**
+ * qstring_get_length(): Get the length of a QString
+ */
+size_t qstring_get_length(const QString *qstring)
+{
+ return qstring->length;
+}
+
+/**
* qstring_from_substr(): Create a new QString from a C string substring
*
* Return string reference