Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

VirtualFileMountSystem Class Reference

Maps an actual OS directory into the VirtualFileSystem. More...

#include <virtualFileMountSystem.h>

Inheritance diagram for VirtualFileMountSystem:

VirtualFileMount TypedObject List of all members.

Public Member Functions

 VirtualFileMountSystem (VirtualFileSystem *file_system, const Filename &physical_filename, const Filename &mount_point, int mount_flags)
virtual bool has_file (const Filename &file) const
 Returns true if the indicated file exists within the mount system.

virtual bool is_directory (const Filename &file) const
 Returns true if the indicated file exists within the mount system and is a directory.

virtual bool is_regular_file (const Filename &file) const
 Returns true if the indicated file exists within the mount system and is a regular file.

virtual istream * open_read_file (const Filename &file) const
 Opens the file for reading, if it exists.

virtual bool scan_directory (vector_string &contents, const Filename &dir) const
 Fills the given vector up with the list of filenames that are local to this directory, if the filename is a directory.

virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
VirtualFileSystemget_file_system () const
 Returns the file system this mount object is attached to.

const Filenameget_physical_filename () const
 Returns the name of the source file on the OS filesystem of the directory or file that is mounted.

const Filenameget_mount_point () const
 Returns the name of the directory within the virtual file system that this mount object is attached to.

int get_mount_flags () const
 Returns the set of flags passed by the user to the VirtualFileSystem::mount() command.

virtual void output (ostream &out) const
virtual void write (ostream &out) const
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.

bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.


Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.


Protected Attributes

VirtualFileSystem_file_system
Filename _physical_filename
Filename _mount_point
int _mount_flags

Static Private Attributes

TypeHandle _type_handle

Detailed Description

Maps an actual OS directory into the VirtualFileSystem.

Definition at line 38 of file virtualFileMountSystem.h.


Constructor & Destructor Documentation

VirtualFileMountSystem::VirtualFileMountSystem VirtualFileSystem file_system,
const Filename physical_filename,
const Filename mount_point,
int  mount_flags
[inline]
 

Definition at line 32 of file virtualFileMountSystem.I.


Member Function Documentation

virtual TypeHandle VirtualFileMountSystem::force_init_type void   )  [inline, virtual]
 

Reimplemented from VirtualFileMount.

Definition at line 59 of file virtualFileMountSystem.h.

TypeHandle VirtualFileMountSystem::get_class_type void   )  [inline, static]
 

Reimplemented from VirtualFileMount.

Definition at line 60 of file virtualFileMountSystem.h.

VirtualFileSystem * VirtualFileMount::get_file_system  )  const [inline, inherited]
 

Returns the file system this mount object is attached to.

Definition at line 54 of file virtualFileMount.I.

References VirtualFileMount::_physical_filename, and INLINE.

int VirtualFileMount::get_mount_flags  )  const [inline, inherited]
 

Returns the set of flags passed by the user to the VirtualFileSystem::mount() command.

Definition at line 102 of file virtualFileMount.I.

const Filename & VirtualFileMount::get_mount_point  )  const [inline, inherited]
 

Returns the name of the directory within the virtual file system that this mount object is attached to.

This directory name will end with a slash.

Definition at line 87 of file virtualFileMount.I.

Referenced by VirtualFileSimple::get_file_system(), and VirtualFileMount::output().

const Filename & VirtualFileMount::get_physical_filename  )  const [inline, inherited]
 

Returns the name of the source file on the OS filesystem of the directory or file that is mounted.

Definition at line 70 of file virtualFileMount.I.

Referenced by VirtualFileMount::output(), and VirtualFileMount::~VirtualFileMount().

virtual TypeHandle VirtualFileMountSystem::get_type void   )  const [inline, virtual]
 

Reimplemented from VirtualFileMount.

Definition at line 56 of file virtualFileMountSystem.h.

References VirtualFileMount::init_type(), and register_type().

int TypedObject::get_type_index  )  const [inline, inherited]
 

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 71 of file typedObject.I.

References TypeHandle::get_name(), TypedObject::get_type(), and INLINE.

bool VirtualFileMountSystem::has_file const Filename file  )  const [virtual]
 

Returns true if the indicated file exists within the mount system.

Implements VirtualFileMount.

Definition at line 38 of file virtualFileMountSystem.cxx.

References VirtualFileMount::_physical_filename, and Filename::is_directory().

void VirtualFileMountSystem::init_type void   )  [inline, static]
 

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from VirtualFileMount.

Definition at line 63 of file virtualFileMountSystem.h.

bool VirtualFileMountSystem::is_directory const Filename file  )  const [virtual]
 

Returns true if the indicated file exists within the mount system and is a directory.

Implements VirtualFileMount.

Definition at line 54 of file virtualFileMountSystem.cxx.

References VirtualFileMount::_physical_filename, and Filename::is_regular_file().

bool TypedObject::is_exact_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is the indicated type exactly.

Definition at line 101 of file typedObject.I.

Referenced by PT(), and CollisionNode::xform().

bool TypedObject::is_of_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is or derives from the indicated type.

Definition at line 86 of file typedObject.I.

Referenced by EggMaterialCollection::collapse_equivalent_materials(), EggTextureCollection::collapse_equivalent_textures(), DeferredNodeProperty::compose(), AnimBundleMaker::create_s_channel(), CharacterMaker::create_slider(), ProjectionScreen::cull_callback(), DataNode::define_output(), EggNode::determine_draw_order(), CharacterMaker::egg_to_index(), EggGroupUniquifier::EggGroupUniquifier(), EggPoolUniquifier::EggPoolUniquifier(), EggGroupNode::find_textures(), StaticTextFont::get_glyph(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), CharacterJoint::make_copy(), PT(), EggGroupNode::r_flatten_transforms(), EggGroupNode::r_transform_vertices(), EggGroupNode::recompute_polygon_normals(), CollisionLevelState::reserve(), PandaFramework::reset_frame_rate(), PandaFramework::set_texture(), EggGroupNode::steal_children(), and DataGraphTraverser::traverse().

bool VirtualFileMountSystem::is_regular_file const Filename file  )  const [virtual]
 

Returns true if the indicated file exists within the mount system and is a regular file.

Implements VirtualFileMount.

Definition at line 70 of file virtualFileMountSystem.cxx.

References NULL.

istream * VirtualFileMountSystem::open_read_file const Filename file  )  const [virtual]
 

Opens the file for reading, if it exists.

Returns a newly allocated istream on success (which you should eventually delete when you are done reading). Returns NULL on failure.

Implements VirtualFileMount.

Definition at line 90 of file virtualFileMountSystem.cxx.

References VirtualFileMount::_physical_filename, and Filename::scan_directory().

void VirtualFileMount::output ostream &  out  )  const [virtual, inherited]
 

Definition at line 48 of file virtualFileMount.cxx.

References VirtualFileMount::get_mount_point(), and VirtualFileMount::get_physical_filename().

bool VirtualFileMountSystem::scan_directory vector_string &  contents,
const Filename dir
const [virtual]
 

Fills the given vector up with the list of filenames that are local to this directory, if the filename is a directory.

Returns true if successful, or false if the file is not a directory or cannot be read.

Implements VirtualFileMount.

Definition at line 118 of file virtualFileMountSystem.cxx.

void VirtualFileMount::write ostream &  out  )  const [virtual, inherited]
 

Definition at line 61 of file virtualFileMount.cxx.


Member Data Documentation

VirtualFileSystem* VirtualFileMount::_file_system [protected, inherited]
 

Definition at line 70 of file virtualFileMount.h.

int VirtualFileMount::_mount_flags [protected, inherited]
 

Definition at line 73 of file virtualFileMount.h.

Filename VirtualFileMount::_mount_point [protected, inherited]
 

Definition at line 72 of file virtualFileMount.h.

Filename VirtualFileMount::_physical_filename [protected, inherited]
 

Definition at line 71 of file virtualFileMount.h.

Referenced by VirtualFileMount::get_file_system(), has_file(), is_directory(), and open_read_file().

TypeHandle VirtualFileMountSystem::_type_handle [static, private]
 

Reimplemented from VirtualFileMount.

Definition at line 24 of file virtualFileMountSystem.cxx.


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:56:07 2003 for Panda by doxygen1.3