FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codegen/codegen/common/checked_utf8_string.h at master-codegen · AyuGram/codegen · GitHub
AyuGram
/
codegen
Public
forked from
desktop-app/codegen
Notifications
You must be signed in to change notification settings
Fork
20
Star
2
Code
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codegen
/
codegen
/
common
/
checked_utf8_string.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (33 loc) · 1.01 KB
Breadcrumbs
codegen
/
codegen
/
common
/
checked_utf8_string.h
Copy path
File metadata and controls
43 lines (33 loc) · 1.01 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
This file is part of Desktop App Toolkit,
//
a set of libraries for developing nice desktop applications.
//
//
For license and copyright information please follow this link:
//
https://github.com/desktop-app/legal/blob/master/LEGAL
//
#
pragma
once
#
include
<
QtCore/QString
>
class
QByteArray
;
namespace
codegen
{
namespace
common
{
class
ConstUtf8String
;
//
Parses a char sequence to a QString using UTF-8 codec.
//
You can check for invalid UTF-8 sequence by isValid() method.
class
CheckedUtf8String
{
public:
CheckedUtf8String
(
const
CheckedUtf8String &other) =
default
;
CheckedUtf8String &
operator
=(
const
CheckedUtf8String &other) =
default
;
explicit
CheckedUtf8String
(
const
char
*string,
int
size = -
1
);
explicit
CheckedUtf8String
(
const
QByteArray &string);
explicit
CheckedUtf8String
(
const
ConstUtf8String &string);
bool
isValid
()
const
{
return
valid_;
}
const
QString &
toString
()
const
{
return
string_;
}
private:
QString string_;
bool
valid_ =
true
;
};
}
//
namespace common
}
//
namespace codegen
Back
|
FazBrowse Home
|
New Git URL