1 /* quark.cc
2  *
3  * Copyright 2002 The gtkmm Development Team
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #include <glibmm/quark.h>
20 
21 namespace Glib
22 {
23 
QueryQuark(const GQuark & q)24 QueryQuark::QueryQuark(const GQuark& q) : quark_(q)
25 {
26 }
27 
QueryQuark(const ustring & s)28 QueryQuark::QueryQuark(const ustring& s) : quark_(g_quark_try_string(s.c_str()))
29 {
30 }
31 
QueryQuark(const char * s)32 QueryQuark::QueryQuark(const char* s) : quark_(g_quark_try_string(s))
33 {
34 }
35 
36 QueryQuark&
operator =(const QueryQuark & q)37 QueryQuark::operator=(const QueryQuark& q)
38 {
39   quark_ = q.quark_;
40   return *this;
41 }
42 
operator ustring() const43 QueryQuark::operator ustring() const
44 {
45   return ustring(g_quark_to_string(quark_));
46 }
47 
Quark(const ustring & s)48 Quark::Quark(const ustring& s) : QueryQuark(g_quark_from_string(s.c_str()))
49 {
50 }
51 
Quark(const char * s)52 Quark::Quark(const char* s) : QueryQuark(g_quark_from_string(s))
53 {
54 }
55 
~Quark()56 Quark::~Quark() noexcept
57 {
58 }
59 
60 GQuark quark_ = 0;
61 GQuark quark_cpp_wrapper_deleted_ = 0;
62 
63 } /* namespace Glib */
64