QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
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 
25 namespace QGlib {
26 
42 class QTGLIB_EXPORT Quark
43 {
44 public:
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 
61 private:
62  quint32 m_quark;
63 };
64 
65 //static
66 inline Quark Quark::fromString(const QString & str)
67 {
68  return fromString(str.toUtf8().constData());
69 }
70 
71 //static
72 inline Quark Quark::tryString(const QString & str)
73 {
74  return tryString(str.toUtf8().constData());
75 }
76 
77 } //namespace QGlib
78 
79 #endif // QGLIB_QUARK_H
static Quark fromString(const char *str)
Definition: quark.cpp:25
static Quark tryString(const char *str)
Definition: quark.cpp:31
Wrapper class for GQuark.
Definition: quark.h:42