Created
March 24, 2020 04:33
-
-
Save vinniefalco/75e80d58a7bac93cd6a7fa0936bec276 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// utf16 escape | |
do_str4: | |
if(BOOST_JSON_LIKELY( | |
cs.remain() >= 4)) | |
{ | |
char d; | |
unsigned short u; | |
d = hex_digit(*cs); | |
if(d == -1) | |
{ | |
ec_ = error::expected_hex_digit; | |
return; | |
} | |
u = d << 12; | |
++cs; | |
d = hex_digit(*cs); | |
if(d == -1) | |
{ | |
ec_ = error::expected_hex_digit; | |
return; | |
} | |
u |= d << 8; | |
++cs; | |
d = hex_digit(*cs); | |
if(d == -1) | |
{ | |
ec_ = error::expected_hex_digit; | |
return; | |
} | |
u |= d << 4; | |
++cs; | |
d = hex_digit(*cs); | |
if(d == -1) | |
{ | |
ec_ = error::expected_hex_digit; | |
return; | |
} | |
u |= d; | |
++cs; | |
u_ = u; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment