qstring.h 884 字节
Newer Older
L
Luiz Capitulino 已提交
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.
 */

L
Luiz Capitulino 已提交
13 14 15
#ifndef QSTRING_H
#define QSTRING_H

16
#include <stdint.h>
L
Luiz Capitulino 已提交
17 18 19 20 21
#include "qobject.h"

typedef struct QString {
    QObject_HEAD;
    char *string;
A
Anthony Liguori 已提交
22 23
    size_t length;
    size_t capacity;
L
Luiz Capitulino 已提交
24 25
} QString;

A
Anthony Liguori 已提交
26
QString *qstring_new(void);
L
Luiz Capitulino 已提交
27
QString *qstring_from_str(const char *str);
28
QString *qstring_from_substr(const char *str, int start, int end);
L
Luiz Capitulino 已提交
29
const char *qstring_get_str(const QString *qstring);
30
void qstring_append_int(QString *qstring, int64_t value);
A
Anthony Liguori 已提交
31
void qstring_append(QString *qstring, const char *str);
32
void qstring_append_chr(QString *qstring, int c);
L
Luiz Capitulino 已提交
33 34 35
QString *qobject_to_qstring(const QObject *obj);

#endif /* QSTRING_H */