2010-05-12 23:34:42 +04: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 22:27:06 +04:00
|
|
|
#ifndef QSTRING_H
|
|
|
|
#define QSTRING_H
|
|
|
|
|
2009-11-19 04:05:26 +03:00
|
|
|
#include <stdint.h>
|
2012-12-17 21:19:43 +04:00
|
|
|
#include "qapi/qmp/qobject.h"
|
2009-08-28 22:27:06 +04:00
|
|
|
|
|
|
|
typedef struct QString {
|
|
|
|
QObject_HEAD;
|
|
|
|
char *string;
|
2009-11-11 19:49:51 +03:00
|
|
|
size_t length;
|
|
|
|
size_t capacity;
|
2009-08-28 22:27:06 +04:00
|
|
|
} QString;
|
|
|
|
|
2009-11-11 19:49:51 +03:00
|
|
|
QString *qstring_new(void);
|
2009-08-28 22:27:06 +04:00
|
|
|
QString *qstring_from_str(const char *str);
|
2009-11-19 04:05:27 +03:00
|
|
|
QString *qstring_from_substr(const char *str, int start, int end);
|
2013-03-25 21:46:37 +04:00
|
|
|
size_t qstring_get_length(const QString *qstring);
|
2009-08-28 22:27:06 +04:00
|
|
|
const char *qstring_get_str(const QString *qstring);
|
2009-11-19 04:05:26 +03:00
|
|
|
void qstring_append_int(QString *qstring, int64_t value);
|
2009-11-11 19:49:51 +03:00
|
|
|
void qstring_append(QString *qstring, const char *str);
|
2009-11-19 04:05:25 +03:00
|
|
|
void qstring_append_chr(QString *qstring, int c);
|
2009-08-28 22:27:06 +04:00
|
|
|
QString *qobject_to_qstring(const QObject *obj);
|
|
|
|
|
|
|
|
#endif /* QSTRING_H */
|