qstring.h 884 Bytes
Newer Older
Luiz Capitulino's avatar
Luiz Capitulino committed
1 2 3 4 5 6 7 8 9 10 11 12
/*
 * QString Module
 *
 * Copyright (C) 2009 Red Hat Inc.
 *
 * Authors:
 *  Luiz Capitulino <lcapitulino@redhat.com>
 *
 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
 * See the COPYING.LIB file in the top-level directory.
 */

Luiz Capitulino's avatar
Luiz Capitulino committed
13 14 15
#ifndef QSTRING_H
#define QSTRING_H

16
#include <stdint.h>
Luiz Capitulino's avatar
Luiz Capitulino committed
17 18 19 20 21
#include "qobject.h"

typedef struct QString {
    QObject_HEAD;
    char *string;
22 23
    size_t length;
    size_t capacity;
Luiz Capitulino's avatar
Luiz Capitulino committed
24 25
} QString;

26
QString *qstring_new(void);
Luiz Capitulino's avatar
Luiz Capitulino committed
27
QString *qstring_from_str(const char *str);
28
QString *qstring_from_substr(const char *str, int start, int end);
Luiz Capitulino's avatar
Luiz Capitulino committed
29
const char *qstring_get_str(const QString *qstring);
30
void qstring_append_int(QString *qstring, int64_t value);
31
void qstring_append(QString *qstring, const char *str);
32
void qstring_append_chr(QString *qstring, int c);
Luiz Capitulino's avatar
Luiz Capitulino committed
33 34 35
QString *qobject_to_qstring(const QObject *obj);

#endif /* QSTRING_H */