Panda3D
iffChunk.cxx
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 iffChunk.cxx
10  * @author drose
11  * @date 2001-04-23
12  */
13 
14 #include "iffChunk.h"
15 #include "iffInputFile.h"
16 
17 #include "indent.h"
18 
19 TypeHandle IffChunk::_type_handle;
20 
21 /**
22  *
23  */
24 void IffChunk::
25 output(std::ostream &out) const {
26  out << _id << " (" << get_type() << ")";
27 }
28 
29 /**
30  *
31  */
32 void IffChunk::
33 write(std::ostream &out, int indent_level) const {
34  indent(out, indent_level) << _id << " { ... }\n";
35 }
36 
37 /**
38  * Allocates and returns a new chunk of the appropriate type based on the
39  * given ID, according to the context given by this chunk itself.
40  */
43  return in->make_new_chunk(id);
44 }
indent
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
IffId
A four-byte chunk ID appearing in an "IFF" file.
Definition: iffId.h:26
IffChunk::make_new_chunk
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:42
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
iffChunk.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
IffInputFile
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:30
iffInputFile.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
indent.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
IffChunk
The basic kind of record in an EA "IFF" file, which the LightWave object file is based on.
Definition: iffChunk.h:30