Panda3D
Loading...
Searching...
No Matches
stringDecoder.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file stringDecoder.I
10 * @author drose
11 * @date 2002-02-11
12 */
13
14/**
15 *
16 */
17INLINE StringDecoder::
18StringDecoder(const std::string &input) : _input(input) {
19 _p = 0;
20 _eof = false;
21}
22
23/**
24 * Returns true if the decoder has returned the last character in the string,
25 * false if there are more to go.
26 */
27INLINE bool StringDecoder::
28is_eof() {
29 return _eof;
30}
31
32/**
33 * If the pointer is past the last character of the string, set the eof flag
34 * and return true.
35 */
36INLINE bool StringDecoder::
37test_eof() {
38 if (_p >= _input.size()) {
39 _eof = true;
40 return true;
41 }
42 return false;
43}
44
45/**
46 *
47 */
48INLINE StringUtf8Decoder::
49StringUtf8Decoder(const std::string &input) : StringDecoder(input) {
50}
51
52/**
53 *
54 */
55INLINE StringUnicodeDecoder::
56StringUtf16Decoder(const std::string &input) : StringDecoder(input) {
57}
The base class to a family of classes that decode various kinds of encoded byte streams.
bool is_eof()
Returns true if the decoder has returned the last character in the string, false if there are more to...