Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P38
Scott's Secret Sauce #1
Active
Public
Actions
Authored by
jcmcdonald
on Mar 10 2018, 7:28 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
Programming [Dept]
BSS [Team]
Subscribers
bdvolwiler
void
OneString
::
append
(
const
char
*
ostr
)
{
// Can tell how many bytes by masking the first character
switch
(
ostr
[
index
]
&
0xF0
)
{
case
0xF0
:
{
// Insert a 4 byte Unicode Char into the OneString
parseChar
(
ostr
,
index
,
4
);
index
+=
4
;
break
;
}
case
0xE0
:
{
// Insert a 3 byte Unicode Char into the OneString
parseChar
(
ostr
,
index
,
3
);
index
+=
3
;
break
;
}
case
0xC0
:
{
// Insert a 2 byte Unicode Char into the OneString
parseChar
(
ostr
,
index
,
2
);
index
+=
2
;
break
;
}
case
0x80
:
{
ioc
<<
cat_error
<<
ta_bold
<<
fg_red
<<
"OneString Error: Invalid Character In String At Position: "
<<
index
<<
io_end
;
return
;
}
default
:
{
// Insert a standard char
parseChar
(
ostr
,
index
,
1
);
++
index
;
}
}
Event Timeline
jcmcdonald
created this paste.
Mar 10 2018, 7:28 PM
2018-03-10 19:28:48 (UTC-8)
Log In to Comment