QtGStreamer 1.2.0
Loading...
Searching...
No Matches
quark.h
1/*
2 Copyright (C) 2009-2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 Copyright (C) 2010 Collabora Ltd.
4 @author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
5
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef QGLIB_QUARK_H
20#define QGLIB_QUARK_H
21
22#include "global.h"
23#include <QtCore/QString>
24
25namespace QGlib {
26
42class QTGLIB_EXPORT Quark
43{
44public:
45 inline Quark(quint32 gquark = 0) : m_quark(gquark) {}
46
48 static Quark fromString(const char *str);
49 static inline Quark fromString(const QString & str);
50
53 static Quark tryString(const char *str);
54 static inline Quark tryString(const QString & str);
55
57 QString toString() const;
58
59 inline operator quint32() const { return m_quark; }
60
61private:
62 quint32 m_quark;
63};
64
65//static
66inline Quark Quark::fromString(const QString & str)
67{
68 return fromString(str.toUtf8().constData());
69}
70
71//static
72inline Quark Quark::tryString(const QString & str)
73{
74 return tryString(str.toUtf8().constData());
75}
76
77} //namespace QGlib
78
79#endif // QGLIB_QUARK_H
Wrapper class for GQuark.
Definition quark.h:43
static Quark fromString(const char *str)
Definition quark.cpp:25
static Quark tryString(const char *str)
Definition quark.cpp:31
Wrappers for Glib and GObject classes.