qstring.h 884 B

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