score
Home
Classes
Namespaces
Files
OpaqueString.hpp
1
#pragma once
2
#include <QString>
3
4
#include <string>
5
6
class
OpaqueString
7
{
8
friend
bool
operator==(
const
OpaqueString
& lhs,
const
OpaqueString
& rhs) noexcept
9
{
10
return
lhs.impl == rhs.impl;
11
}
12
13
friend
bool
operator!=(
const
OpaqueString
& lhs,
const
OpaqueString
& rhs) noexcept
14
{
15
return
lhs.impl != rhs.impl;
16
}
17
18
friend
bool
operator<(
const
OpaqueString
& lhs,
const
OpaqueString
& rhs) noexcept
19
{
20
return
lhs.impl < rhs.impl;
21
}
22
23
public
:
24
OpaqueString
() =
default
;
25
26
explicit
OpaqueString
(
const
char
* str) noexcept
27
: impl{str}
28
{
29
}
30
explicit
OpaqueString
(std::string str) noexcept
31
: impl{std::move(str)}
32
{
33
}
34
explicit
OpaqueString
(
const
QString& str) noexcept
35
: impl{str.toStdString()}
36
{
37
}
38
39
explicit
OpaqueString
(
const
OpaqueString
& str) noexcept
40
: impl{str.impl}
41
{
42
}
43
explicit
OpaqueString
(
OpaqueString
&& str) noexcept
44
: impl{std::move(str.impl)}
45
{
46
}
47
48
OpaqueString
& operator=(
const
OpaqueString
& str) noexcept
49
{
50
impl = str.impl;
51
return
*
this
;
52
}
53
OpaqueString
& operator=(
OpaqueString
&& str) noexcept
54
{
55
impl = std::move(str.impl);
56
return
*
this
;
57
}
58
59
protected
:
60
std::string impl;
61
};
OpaqueString
Definition:
OpaqueString.hpp:7