2010-05-12 21:34:42 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2009-08-28 20:27:06 +02:00
|
|
|
#ifndef QSTRING_H
|
|
|
|
#define QSTRING_H
|
|
|
|
|
2012-12-17 18:19:43 +01:00
|
|
|
#include "qapi/qmp/qobject.h"
|
2009-08-28 20:27:06 +02:00
|
|
|
|
2018-02-01 12:18:34 +01:00
|
|
|
struct QString {
|
2018-04-19 17:01:42 +02:00
|
|
|
struct QObjectBase_ base;
|
2009-08-28 20:27:06 +02:00
|
|
|
char *string;
|
2009-11-11 17:49:51 +01:00
|
|
|
size_t length;
|
|
|
|
size_t capacity;
|
2018-02-01 12:18:34 +01:00
|
|
|
};
|
2009-08-28 20:27:06 +02:00
|
|
|
|
2009-11-11 17:49:51 +01:00
|
|
|
QString *qstring_new(void);
|
2009-08-28 20:27:06 +02:00
|
|
|
QString *qstring_from_str(const char *str);
|
2018-07-24 15:43:39 +02:00
|
|
|
QString *qstring_from_substr(const char *str, size_t start, size_t end);
|
2013-03-25 18:46:37 +01:00
|
|
|
size_t qstring_get_length(const QString *qstring);
|
2009-08-28 20:27:06 +02:00
|
|
|
const char *qstring_get_str(const QString *qstring);
|
2018-03-09 09:59:45 +01:00
|
|
|
const char *qstring_get_try_str(const QString *qstring);
|
2018-03-09 09:59:46 +01:00
|
|
|
const char *qobject_get_try_str(const QObject *qstring);
|
2009-11-19 02:05:26 +01:00
|
|
|
void qstring_append_int(QString *qstring, int64_t value);
|
2009-11-11 17:49:51 +01:00
|
|
|
void qstring_append(QString *qstring, const char *str);
|
2009-11-19 02:05:25 +01:00
|
|
|
void qstring_append_chr(QString *qstring, int c);
|
2017-11-14 19:01:25 +01:00
|
|
|
bool qstring_is_equal(const QObject *x, const QObject *y);
|
2015-12-02 06:20:45 +01:00
|
|
|
void qstring_destroy_obj(QObject *obj);
|
2009-08-28 20:27:06 +02:00
|
|
|
|
|
|
|
#endif /* QSTRING_H */
|