From 66f7048712693a6ff877209c1ff36aa8eadf2eb5 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 28 Aug 2009 15:27:06 -0300 Subject: Introduce QString QString is a high-level data type that can be used to represent C strings. The following functions are available: - qstring_from_str() Create a new QString - qstring_get_str() Get a pointer to the stored string Note that qstring_get_str() is too low-level for a data type like this, but it's interesting for quick read-only accesses. Signed-off-by: Luiz Capitulino Signed-off-by: Anthony Liguori --- qstring.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 qstring.h (limited to 'qstring.h') diff --git a/qstring.h b/qstring.h new file mode 100644 index 000000000..e012cb7dc --- /dev/null +++ b/qstring.h @@ -0,0 +1,15 @@ +#ifndef QSTRING_H +#define QSTRING_H + +#include "qobject.h" + +typedef struct QString { + QObject_HEAD; + char *string; +} QString; + +QString *qstring_from_str(const char *str); +const char *qstring_get_str(const QString *qstring); +QString *qobject_to_qstring(const QObject *obj); + +#endif /* QSTRING_H */ -- cgit v1.2.3