FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codegen/codegen/common/checked_utf8_string.cpp 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
19
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.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (28 loc) · 952 Bytes
Breadcrumbs
codegen
/
codegen
/
common
/
checked_utf8_string.cpp
Copy path
File metadata and controls
35 lines (28 loc) · 952 Bytes
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
//
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
//
#
include
"
codegen/common/checked_utf8_string.h
"
#
include
"
codegen/common/const_utf8_string.h
"
namespace
codegen
{
namespace
common
{
CheckedUtf8String::CheckedUtf8String
(
const
char
*string,
int
size) {
if
(size <
0
) {
size =
strlen
(string);
}
if
(!size) {
//
Valid empty string
return
;
}
string_ =
QString::fromUtf8
(string, size);
if
(string_.
contains
(QChar::ReplacementCharacter)) {
valid_ =
false
;
}
}
CheckedUtf8String::CheckedUtf8String
(
const
QByteArray &string) : CheckedUtf8String(string.constData(), string.size()) {
}
CheckedUtf8String::CheckedUtf8String
(
const
ConstUtf8String &string) : CheckedUtf8String(string.data(), string.size()) {
}
}
//
namespace common
}
//
namespace codegen
Back
|
FazBrowse Home
|
New Git URL