blob: 84ccd96d61fd2f3b73b6e129dbb4097437288957 [file] [log] [blame]
Luiz Capitulino41836a92010-05-12 16:34:42 -03001/*
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 Capitulino66f70482009-08-28 15:27:06 -030013#ifndef QSTRING_H
14#define QSTRING_H
15
Luiz Capitulino764c1ca2009-11-18 23:05:26 -020016#include <stdint.h>
Luiz Capitulino66f70482009-08-28 15:27:06 -030017#include "qobject.h"
18
19typedef struct QString {
20 QObject_HEAD;
21 char *string;
Anthony Liguorid30ec842009-11-11 10:49:51 -060022 size_t length;
23 size_t capacity;
Luiz Capitulino66f70482009-08-28 15:27:06 -030024} QString;
25
Anthony Liguorid30ec842009-11-11 10:49:51 -060026QString *qstring_new(void);
Luiz Capitulino66f70482009-08-28 15:27:06 -030027QString *qstring_from_str(const char *str);
Luiz Capitulino4b5c5762009-11-18 23:05:27 -020028QString *qstring_from_substr(const char *str, int start, int end);
Luiz Capitulino66f70482009-08-28 15:27:06 -030029const char *qstring_get_str(const QString *qstring);
Luiz Capitulino764c1ca2009-11-18 23:05:26 -020030void qstring_append_int(QString *qstring, int64_t value);
Anthony Liguorid30ec842009-11-11 10:49:51 -060031void qstring_append(QString *qstring, const char *str);
Luiz Capitulino6fe95652009-11-18 23:05:25 -020032void qstring_append_chr(QString *qstring, int c);
Luiz Capitulino66f70482009-08-28 15:27:06 -030033QString *qobject_to_qstring(const QObject *obj);
34
35#endif /* QSTRING_H */