00001 // Filename: virtualFileComposite.h 00002 // Created by: drose (03Aug02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef VIRTUALFILECOMPOSITE_H 00020 #define VIRTUALFILECOMPOSITE_H 00021 00022 #include "pandabase.h" 00023 00024 #include "virtualFile.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : VirtualFileComposite 00028 // Description : A composite directory within the VirtualFileSystem: 00029 // this maps to more than one directory on different 00030 // mount points. The resulting directory appears to be 00031 // the union of all the individual simple directories. 00032 //////////////////////////////////////////////////////////////////// 00033 class EXPCL_PANDAEXPRESS VirtualFileComposite : public VirtualFile { 00034 public: 00035 INLINE VirtualFileComposite(VirtualFileSystem *file_system, 00036 const Filename &filename); 00037 00038 INLINE void add_component(VirtualFile *file); 00039 00040 virtual VirtualFileSystem *get_file_system() const; 00041 virtual Filename get_filename() const; 00042 00043 virtual bool is_directory() const; 00044 00045 protected: 00046 virtual bool scan_local_directory(VirtualFileList *file_list, 00047 const ov_set<string> &mount_points) const; 00048 00049 private: 00050 VirtualFileSystem *_file_system; 00051 Filename _filename; 00052 typedef pvector< PT(VirtualFile) > Components; 00053 Components _components; 00054 00055 public: 00056 virtual TypeHandle get_type() const { 00057 return get_class_type(); 00058 } 00059 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00060 00061 PUBLISHED: 00062 static TypeHandle get_class_type() { 00063 return _type_handle; 00064 } 00065 00066 public: 00067 static void init_type() { 00068 VirtualFile::init_type(); 00069 register_type(_type_handle, "VirtualFileComposite", 00070 VirtualFile::get_class_type()); 00071 } 00072 00073 private: 00074 static TypeHandle _type_handle; 00075 }; 00076 00077 #include "virtualFileComposite.I" 00078 00079 #endif