1 #ifndef QSTRING_H 2 #define QSTRING_H 3 4 #include <stdint.h> 5 #include "qobject.h" 6 7 typedef struct QString { 8 QObject_HEAD; 9 char *string; 10 size_t length; 11 size_t capacity; 12 } QString; 13 14 QString *qstring_new(void); 15 QString *qstring_from_str(const char *str); 16 QString *qstring_from_substr(const char *str, int start, int end); 17 const char *qstring_get_str(const QString *qstring); 18 void qstring_append_int(QString *qstring, int64_t value); 19 void qstring_append(QString *qstring, const char *str); 20 void qstring_append_chr(QString *qstring, int c); 21 QString *qobject_to_qstring(const QObject *obj); 22 23 #endif /* QSTRING_H */ 24