00001 // Filename: stringDecoder.I 00002 // Created by: drose (11Feb02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: StringDecoder::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE StringDecoder:: 00026 StringDecoder(const string &input) : _input(input) { 00027 _p = 0; 00028 _eof = false; 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: StringDecoder::is_eof 00033 // Access: Public 00034 // Description: Returns true if the decoder has returned the last 00035 // character in the string, false if there are more to 00036 // go. 00037 //////////////////////////////////////////////////////////////////// 00038 INLINE bool StringDecoder:: 00039 is_eof() { 00040 return _eof; 00041 } 00042 00043 //////////////////////////////////////////////////////////////////// 00044 // Function: StringDecoder::test_eof 00045 // Access: Protected 00046 // Description: If the pointer is past the last character of the 00047 // string, set the eof flag and return true. 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE bool StringDecoder:: 00050 test_eof() { 00051 if (_p >= _input.size()) { 00052 _eof = true; 00053 return true; 00054 } 00055 return false; 00056 } 00057 00058 //////////////////////////////////////////////////////////////////// 00059 // Function: StringUtf8Decoder::Constructor 00060 // Access: Public 00061 // Description: 00062 //////////////////////////////////////////////////////////////////// 00063 INLINE StringUtf8Decoder:: 00064 StringUtf8Decoder(const string &input) : StringDecoder(input) { 00065 } 00066 00067 //////////////////////////////////////////////////////////////////// 00068 // Function: StringUnicodeDecoder::Constructor 00069 // Access: Public 00070 // Description: 00071 //////////////////////////////////////////////////////////////////// 00072 INLINE StringUnicodeDecoder:: 00073 StringUnicodeDecoder(const string &input) : StringDecoder(input) { 00074 }