Panda3D
iffChunk.cxx
1 // Filename: iffChunk.cxx
2 // Created by: drose (23Apr01)
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 #include "iffChunk.h"
16 #include "iffInputFile.h"
17 
18 #include "indent.h"
19 
20 TypeHandle IffChunk::_type_handle;
21 
22 ////////////////////////////////////////////////////////////////////
23 // Function: IffChunk::output
24 // Access: Public, Virtual
25 // Description:
26 ////////////////////////////////////////////////////////////////////
27 void IffChunk::
28 output(ostream &out) const {
29  out << _id << " (" << get_type() << ")";
30 }
31 
32 ////////////////////////////////////////////////////////////////////
33 // Function: IffChunk::write
34 // Access: Public, Virtual
35 // Description:
36 ////////////////////////////////////////////////////////////////////
37 void IffChunk::
38 write(ostream &out, int indent_level) const {
39  indent(out, indent_level) << _id << " { ... }\n";
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function: IffChunk::make_new_chunk
44 // Access: Public, Virtual
45 // Description: Allocates and returns a new chunk of the appropriate
46 // type based on the given ID, according to the context
47 // given by this chunk itself.
48 ////////////////////////////////////////////////////////////////////
51  return in->make_new_chunk(id);
52 }
virtual IffChunk * make_new_chunk(IffInputFile *in, IffId id)
Allocates and returns a new chunk of the appropriate type based on the given ID, according to the con...
Definition: iffChunk.cxx:50
The basic kind of record in an EA "IFF" file, which the LightWave object file is based on...
Definition: iffChunk.h:32
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A four-byte chunk ID appearing in an "IFF" file.
Definition: iffId.h:29