Panda3D
iffInputFile.I
1 // Filename: iffInputFile.I
2 // Created by: drose (24Apr01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: IffInputFile::set_filename
18 // Access: Public
19 // Description: Indicates the filename that the InputFile is
20 // currently opened on.
21 ////////////////////////////////////////////////////////////////////
22 INLINE void IffInputFile::
23 set_filename(const Filename &filename) {
24  _filename = filename;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: IffInputFile::get_filename
29 // Access: Public
30 // Description: Returns the filename that the InputFile is
31 // currently opened on, if available.
32 ////////////////////////////////////////////////////////////////////
33 INLINE const Filename &IffInputFile::
34 get_filename() const {
35  return _filename;
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: IffInputFile::is_eof
40 // Access: Public
41 // Description: Returns true if the last read operation failed
42 // because of reaching EOF, false otherwise.
43 ////////////////////////////////////////////////////////////////////
44 INLINE bool IffInputFile::
45 is_eof() const {
46  return _eof;
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: IffInputFile::get_bytes_read
51 // Access: Public
52 // Description: Returns the number of bytes read so far from the
53 // input file.
54 ////////////////////////////////////////////////////////////////////
55 INLINE size_t IffInputFile::
56 get_bytes_read() const {
57  return _bytes_read;
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: IffInputFile::align
62 // Access: Public
63 // Description: If the current file pointer is not positioned on an
64 // even-byte boundary, reads and discards one byte so
65 // that it is.
66 ////////////////////////////////////////////////////////////////////
67 INLINE void IffInputFile::
68 align() {
69  if ((_bytes_read & 1) != 0) {
70  get_int8();
71  }
72 }
void align()
If the current file pointer is not positioned on an even-byte boundary, reads and discards one byte s...
Definition: iffInputFile.I:68
void set_filename(const Filename &filename)
Indicates the filename that the InputFile is currently opened on.
Definition: iffInputFile.I:23
size_t get_bytes_read() const
Returns the number of bytes read so far from the input file.
Definition: iffInputFile.I:56
const Filename & get_filename() const
Returns the filename that the InputFile is currently opened on, if available.
Definition: iffInputFile.I:34
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
PN_int8 get_int8()
Extracts a signed 8-bit integer.
bool is_eof() const
Returns true if the last read operation failed because of reaching EOF, false otherwise.
Definition: iffInputFile.I:45