Panda3D
Loading...
Searching...
No Matches
iffInputFile.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 iffInputFile.I
10 * @author drose
11 * @date 2001-04-24
12 */
13
14/**
15 * Indicates the filename that the InputFile is currently opened on.
16 */
17INLINE void IffInputFile::
18set_filename(const Filename &filename) {
19 _filename = filename;
20}
21
22/**
23 * Returns the filename that the InputFile is currently opened on, if
24 * available.
25 */
27get_filename() const {
28 return _filename;
29}
30
31/**
32 * Returns true if the last read operation failed because of reaching EOF,
33 * false otherwise.
34 */
35INLINE bool IffInputFile::
36is_eof() const {
37 return _eof;
38}
39
40/**
41 * Returns the number of bytes read so far from the input file.
42 */
43INLINE size_t IffInputFile::
44get_bytes_read() const {
45 return _bytes_read;
46}
47
48/**
49 * If the current file pointer is not positioned on an even-byte boundary,
50 * reads and discards one byte so that it is.
51 */
52INLINE void IffInputFile::
53align() {
54 if ((_bytes_read & 1) != 0) {
55 get_int8();
56 }
57}
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
size_t get_bytes_read() const
Returns the number of bytes read so far from the input file.
int8_t get_int8()
Extracts a signed 8-bit integer.
const Filename & get_filename() const
Returns the filename that the InputFile is currently opened on, if available.
void align()
If the current file pointer is not positioned on an even-byte boundary, reads and discards one byte s...
bool is_eof() const
Returns true if the last read operation failed because of reaching EOF, false otherwise.
void set_filename(const Filename &filename)
Indicates the filename that the InputFile is currently opened on.