~ahs3/+junk/cq-qemu

« back to all changes in this revision

Viewing changes to qstring.h

  • Committer: Al Stone
  • Date: 2012-02-09 01:17:20 UTC
  • Revision ID: albert.stone@canonical.com-20120209011720-tztl7ik3qayz80p4
first commit to bzr for qemu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 <stdint.h>
 
17
#include "qobject.h"
 
18
 
 
19
typedef struct QString {
 
20
    QObject_HEAD;
 
21
    char *string;
 
22
    size_t length;
 
23
    size_t capacity;
 
24
} QString;
 
25
 
 
26
QString *qstring_new(void);
 
27
QString *qstring_from_str(const char *str);
 
28
QString *qstring_from_substr(const char *str, int start, int end);
 
29
const char *qstring_get_str(const QString *qstring);
 
30
void qstring_append_int(QString *qstring, int64_t value);
 
31
void qstring_append(QString *qstring, const char *str);
 
32
void qstring_append_chr(QString *qstring, int c);
 
33
QString *qobject_to_qstring(const QObject *obj);
 
34
 
 
35
#endif /* QSTRING_H */