17 std::ostream *StringDecoder::_notify_ptr = &std::cerr;
    34   return (
unsigned char)_input[_p++];
    45   _notify_ptr = notify_ptr;
    91     result = (
unsigned char)_input[_p++];
    92     if ((result & 0x80) == 0) {
    96     } 
if ((result & 0xe0) == 0xc0) {
   100         if (_notify_ptr != 
nullptr) {
   102             << 
"utf-8 encoded string '" << _input << 
"' ends abruptly.\n";
   106       two = (
unsigned char)_input[_p++];
   107       result = ((result & 0x1f) << 6) | (two & 0x3f);
   110     } 
else if ((result & 0xf0) == 0xe0) {
   113         if (_notify_ptr != 
nullptr) {
   115             << 
"utf-8 encoded string '" << _input << 
"' ends abruptly.\n";
   119       unsigned int two = (
unsigned char)_input[_p++];
   121         if (_notify_ptr != 
nullptr) {
   123             << 
"utf-8 encoded string '" << _input << 
"' ends abruptly.\n";
   127       unsigned int three = (
unsigned char)_input[_p++];
   128       result = ((result & 0x0f) << 12) | ((two & 0x3f) << 6) | (three & 0x3f);
   131     } 
else if ((result & 0xf8) == 0xf0) {
   134         if (_notify_ptr != 
nullptr) {
   136             << 
"utf-8 encoded string '" << _input << 
"' ends abruptly.\n";
   140       unsigned int two = (
unsigned char)_input[_p++];
   142         if (_notify_ptr != 
nullptr) {
   144             << 
"utf-8 encoded string '" << _input << 
"' ends abruptly.\n";
   148       unsigned int three = (
unsigned char)_input[_p++];
   150         if (_notify_ptr != 
nullptr) {
   152             << 
"utf-8 encoded string '" << _input << 
"' ends abruptly.\n";
   156       unsigned int four = (
unsigned char)_input[_p++];
   157       result = ((result & 0x07) << 18) | ((two & 0x3f) << 12) | ((three & 0x3f) << 6) | (four & 0x3f);
   163     if (_notify_ptr != 
nullptr) {
   165         << 
"Non utf-8 byte in string: 0x" << std::hex << result << std::dec
   166         << 
", string is '" << _input << 
"'\n";
   184   unsigned int high = (
unsigned char)_input[_p++];
   186     if (_notify_ptr != 
nullptr) {
   188         << 
"Unicode-encoded string has odd number of bytes.\n";
   192   unsigned int low = (
unsigned char)_input[_p++];
   193   int ch = ((high << 8) | low);
   209   if (ch >= 0xd800 && ch < 0xdc00 && (_p + 1) < _input.size()) {
   211     unsigned int high = (
unsigned char)_input[_p];
   212     unsigned int low = (
unsigned char)_input[_p + 1];
   213     int ch2 = ((high << 8) | low);
   214     if (ch2 >= 0xdc00 && ch2 < 0xe000) {
   217       return 0x10000 + ((ch - 0xd800) << 10) + (ch2 - 0xdc00);
 virtual char32_t get_next_character()
Returns the next character in sequence.
virtual char32_t get_next_character()
Returns the next character in sequence.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual char32_t get_next_character()
Returns the next character in sequence.
static void set_notify_ptr(std::ostream *ptr)
Sets the ostream that is used to write error messages to.
static std::ostream * get_notify_ptr()
Returns the ostream that is used to write error messages to.