15 #include "loaderFileTypeBam.h"
16 #include "config_pgraph.h"
18 #include "bamCacheRecord.h"
19 #include "modelRoot.h"
20 #include "loaderOptions.h"
40 string LoaderFileTypeBam::
50 string LoaderFileTypeBam::
51 get_extension()
const {
100 record->add_dependent_file(path);
103 bool report_errors = (options.get_flags() & LoaderOptions::LF_report_errors) != 0;
106 if (!bam_file.
open_read(path, report_errors)) {
112 PT(
PandaNode) node = bam_file.read_node(report_errors);
128 bool LoaderFileTypeBam::
133 bool report_errors = (options.get_flags() & LoaderOptions::LF_report_errors) != 0;
137 if (bam_file.
open_write(path, report_errors)) {
The principle public interface to reading and writing Bam disk files.
A node of this type is created automatically at the root of each model file that is loaded...
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz extension)...
bool write_object(const TypedWritable *object)
Writes the indicated object to the Bam file.
A basic node of the scene graph or data graph.
bool open_read(const Filename &bam_filename, bool report_errors=true)
Attempts to open the indicated filename for reading.
virtual bool supports_load() const
Returns true if the file type can be used to load files, and load_file() is supported.
Specifies parameters that may be passed to the loader.
void set_fullpath(const Filename &fullpath)
Sets the full pathname of the model represented by this node, as found on disk.
This defines the Loader interface to read Bam files.
void close()
Closes the input or output stream.
BamReader * get_reader()
Returns the BamReader in charge of performing the read operations.
void set_loader_options(const LoaderOptions &options)
Specifies the LoaderOptions for this BamReader.
void set_timestamp(time_t timestamp)
Sets the timestamp of the file on disk that was read for this model.
The name of a file, such as a texture file or an Egg file.
An instance of this class is written to the front of a Bam or Txo file to make the file a cached inst...
virtual bool supports_save() const
Returns true if the file type can be used to save files, and save_file() is supported.
DatagramGenerator * get_source()
Returns the current source of the BamReader as set by set_source() or the constructor.
virtual time_t get_timestamp() const
Returns the on-disk timestamp of the file that was read, at the time it was opened, if that is available, or 0 if it is not.
bool open_write(const Filename &bam_filename, bool report_errors=true)
Attempts to open the indicated file for writing.
TypeHandle is the identifier used to differentiate C++ class types.