qemu/include/qapi/qmp/qstring.h
<<
>>
Prefs
   1/*
   2 * QString Module
   3 *
   4 * Copyright (C) 2009 Red Hat Inc.
   5 *
   6 * Authors:
   7 *  Luiz Capitulino <lcapitulino@redhat.com>
   8 *
   9 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
  10 * See the COPYING.LIB file in the top-level directory.
  11 */
  12
  13#ifndef QSTRING_H
  14#define QSTRING_H
  15
  16#include "qapi/qmp/qobject.h"
  17
  18struct QString {
  19    struct QObjectBase_ base;
  20    char *string;
  21    size_t length;
  22    size_t capacity;
  23};
  24
  25QString *qstring_new(void);
  26QString *qstring_from_str(const char *str);
  27QString *qstring_from_substr(const char *str, size_t start, size_t end);
  28size_t qstring_get_length(const QString *qstring);
  29const char *qstring_get_str(const QString *qstring);
  30const char *qstring_get_try_str(const QString *qstring);
  31const char *qobject_get_try_str(const QObject *qstring);
  32void qstring_append_int(QString *qstring, int64_t value);
  33void qstring_append(QString *qstring, const char *str);
  34void qstring_append_chr(QString *qstring, int c);
  35bool qstring_is_equal(const QObject *x, const QObject *y);
  36void qstring_destroy_obj(QObject *obj);
  37
  38#endif /* QSTRING_H */
  39