mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-30 15:00:34 +00:00
164c374b75
Similar to g_string_free(), optionally return the underlying char*. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-10-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
/*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef QSTRING_H
|
|
#define QSTRING_H
|
|
|
|
#include "qapi/qmp/qobject.h"
|
|
|
|
struct QString {
|
|
struct QObjectBase_ base;
|
|
char *string;
|
|
size_t length;
|
|
size_t capacity;
|
|
};
|
|
|
|
QString *qstring_new(void);
|
|
QString *qstring_from_str(const char *str);
|
|
QString *qstring_from_substr(const char *str, size_t start, size_t end);
|
|
size_t qstring_get_length(const QString *qstring);
|
|
const char *qstring_get_str(const QString *qstring);
|
|
const char *qstring_get_try_str(const QString *qstring);
|
|
const char *qobject_get_try_str(const QObject *qstring);
|
|
void qstring_append_int(QString *qstring, int64_t value);
|
|
void qstring_append(QString *qstring, const char *str);
|
|
void qstring_append_chr(QString *qstring, int c);
|
|
bool qstring_is_equal(const QObject *x, const QObject *y);
|
|
char *qstring_free(QString *qstring, bool return_str);
|
|
void qstring_destroy_obj(QObject *obj);
|
|
|
|
#endif /* QSTRING_H */
|