Panda3D
|
00001 // Filename: stringDecoder.I 00002 // Created by: drose (11Feb02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: StringDecoder::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE StringDecoder:: 00022 StringDecoder(const string &input) : _input(input) { 00023 _p = 0; 00024 _eof = false; 00025 } 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: StringDecoder::is_eof 00029 // Access: Public 00030 // Description: Returns true if the decoder has returned the last 00031 // character in the string, false if there are more to 00032 // go. 00033 //////////////////////////////////////////////////////////////////// 00034 INLINE bool StringDecoder:: 00035 is_eof() { 00036 return _eof; 00037 } 00038 00039 //////////////////////////////////////////////////////////////////// 00040 // Function: StringDecoder::test_eof 00041 // Access: Protected 00042 // Description: If the pointer is past the last character of the 00043 // string, set the eof flag and return true. 00044 //////////////////////////////////////////////////////////////////// 00045 INLINE bool StringDecoder:: 00046 test_eof() { 00047 if (_p >= _input.size()) { 00048 _eof = true; 00049 return true; 00050 } 00051 return false; 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: StringUtf8Decoder::Constructor 00056 // Access: Public 00057 // Description: 00058 //////////////////////////////////////////////////////////////////// 00059 INLINE StringUtf8Decoder:: 00060 StringUtf8Decoder(const string &input) : StringDecoder(input) { 00061 } 00062 00063 //////////////////////////////////////////////////////////////////// 00064 // Function: StringUnicodeDecoder::Constructor 00065 // Access: Public 00066 // Description: 00067 //////////////////////////////////////////////////////////////////// 00068 INLINE StringUnicodeDecoder:: 00069 StringUnicodeDecoder(const string &input) : StringDecoder(input) { 00070 }