Panda3D
|
00001 // Filename: virtualFileComposite.h 00002 // Created by: drose (03Aug02) 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 #ifndef VIRTUALFILECOMPOSITE_H 00016 #define VIRTUALFILECOMPOSITE_H 00017 00018 #include "pandabase.h" 00019 00020 #include "virtualFile.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : VirtualFileComposite 00024 // Description : A composite directory within the VirtualFileSystem: 00025 // this maps to more than one directory on different 00026 // mount points. The resulting directory appears to be 00027 // the union of all the individual simple directories. 00028 //////////////////////////////////////////////////////////////////// 00029 class EXPCL_PANDAEXPRESS VirtualFileComposite : public VirtualFile { 00030 public: 00031 INLINE VirtualFileComposite(VirtualFileSystem *file_system, 00032 const Filename &filename); 00033 00034 INLINE void add_component(VirtualFile *file); 00035 00036 virtual VirtualFileSystem *get_file_system() const; 00037 virtual Filename get_filename() const; 00038 00039 virtual bool has_file() const; 00040 virtual bool is_directory() const; 00041 00042 protected: 00043 virtual bool scan_local_directory(VirtualFileList *file_list, 00044 const ov_set<string> &mount_points) const; 00045 00046 private: 00047 VirtualFileSystem *_file_system; 00048 Filename _filename; 00049 typedef pvector< PT(VirtualFile) > Components; 00050 Components _components; 00051 00052 public: 00053 virtual TypeHandle get_type() const { 00054 return get_class_type(); 00055 } 00056 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00057 00058 PUBLISHED: 00059 static TypeHandle get_class_type() { 00060 return _type_handle; 00061 } 00062 00063 public: 00064 static void init_type() { 00065 VirtualFile::init_type(); 00066 register_type(_type_handle, "VirtualFileComposite", 00067 VirtualFile::get_class_type()); 00068 } 00069 00070 private: 00071 static TypeHandle _type_handle; 00072 }; 00073 00074 #include "virtualFileComposite.I" 00075 00076 #endif