Panda3D

iffInputFile.I

00001 // Filename: iffInputFile.I
00002 // Created by:  drose (24Apr01)
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: IffInputFile::set_filename
00018 //       Access: Public
00019 //  Description: Indicates the filename that the InputFile is
00020 //               currently opened on.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE void IffInputFile::
00023 set_filename(const Filename &filename) {
00024   _filename = filename;
00025 }
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //     Function: IffInputFile::get_filename
00029 //       Access: Public
00030 //  Description: Returns the filename that the InputFile is
00031 //               currently opened on, if available.
00032 ////////////////////////////////////////////////////////////////////
00033 INLINE const Filename &IffInputFile::
00034 get_filename() const {
00035   return _filename;
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: IffInputFile::is_eof
00040 //       Access: Public
00041 //  Description: Returns true if the last read operation failed
00042 //               because of reaching EOF, false otherwise.
00043 ////////////////////////////////////////////////////////////////////
00044 INLINE bool IffInputFile::
00045 is_eof() const {
00046   return _eof;
00047 }
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //     Function: IffInputFile::get_bytes_read
00051 //       Access: Public
00052 //  Description: Returns the number of bytes read so far from the
00053 //               input file.
00054 ////////////////////////////////////////////////////////////////////
00055 INLINE size_t IffInputFile::
00056 get_bytes_read() const {
00057   return _bytes_read;
00058 }
00059 
00060 ////////////////////////////////////////////////////////////////////
00061 //     Function: IffInputFile::align
00062 //       Access: Public
00063 //  Description: If the current file pointer is not positioned on an
00064 //               even-byte boundary, reads and discards one byte so
00065 //               that it is.
00066 ////////////////////////////////////////////////////////////////////
00067 INLINE void IffInputFile::
00068 align() {
00069   if ((_bytes_read & 1) != 0) {
00070     get_int8();
00071   }
00072 }
 All Classes Functions Variables Enumerations