Luiz Capitulino | 41836a9 | 2010-05-12 16:34:42 -0300 | [diff] [blame] | 1 | /* |
| 2 | * QString Module |
| 3 | * |
| 4 | * Copyright (C) 2009 Red Hat Inc. |
| 5 | * |
| 6 | * Authors: |
| 7 | * Luiz Capitulino <lcapitulino@redhat.com> |
| 8 | * |
| 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. |
| 10 | * See the COPYING.LIB file in the top-level directory. |
| 11 | */ |
| 12 | |
Luiz Capitulino | 66f7048 | 2009-08-28 15:27:06 -0300 | [diff] [blame] | 13 | #ifndef QSTRING_H |
| 14 | #define QSTRING_H |
| 15 | |
Luiz Capitulino | 764c1ca | 2009-11-18 23:05:26 -0200 | [diff] [blame] | 16 | #include <stdint.h> |
Luiz Capitulino | 66f7048 | 2009-08-28 15:27:06 -0300 | [diff] [blame] | 17 | #include "qobject.h" |
| 18 | |
| 19 | typedef struct QString { |
| 20 | QObject_HEAD; |
| 21 | char *string; |
Anthony Liguori | d30ec84 | 2009-11-11 10:49:51 -0600 | [diff] [blame] | 22 | size_t length; |
| 23 | size_t capacity; |
Luiz Capitulino | 66f7048 | 2009-08-28 15:27:06 -0300 | [diff] [blame] | 24 | } QString; |
| 25 | |
Anthony Liguori | d30ec84 | 2009-11-11 10:49:51 -0600 | [diff] [blame] | 26 | QString *qstring_new(void); |
Luiz Capitulino | 66f7048 | 2009-08-28 15:27:06 -0300 | [diff] [blame] | 27 | QString *qstring_from_str(const char *str); |
Luiz Capitulino | 4b5c576 | 2009-11-18 23:05:27 -0200 | [diff] [blame] | 28 | QString *qstring_from_substr(const char *str, int start, int end); |
Luiz Capitulino | 66f7048 | 2009-08-28 15:27:06 -0300 | [diff] [blame] | 29 | const char *qstring_get_str(const QString *qstring); |
Luiz Capitulino | 764c1ca | 2009-11-18 23:05:26 -0200 | [diff] [blame] | 30 | void qstring_append_int(QString *qstring, int64_t value); |
Anthony Liguori | d30ec84 | 2009-11-11 10:49:51 -0600 | [diff] [blame] | 31 | void qstring_append(QString *qstring, const char *str); |
Luiz Capitulino | 6fe9565 | 2009-11-18 23:05:25 -0200 | [diff] [blame] | 32 | void qstring_append_chr(QString *qstring, int c); |
Luiz Capitulino | 66f7048 | 2009-08-28 15:27:06 -0300 | [diff] [blame] | 33 | QString *qobject_to_qstring(const QObject *obj); |
| 34 | |
| 35 | #endif /* QSTRING_H */ |