virtualFileMountMultifile.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Filename: virtualFileMountMultifile.h
  2. // Created by: drose (03Aug02)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef VIRTUALFILEMOUNTMULTIFILE_H
  19. #define VIRTUALFILEMOUNTMULTIFILE_H
  20. #include "pandabase.h"
  21. #include "virtualFileMount.h"
  22. #include "multifile.h"
  23. ////////////////////////////////////////////////////////////////////
  24. // Class : VirtualFileMountMultifile
  25. // Description : Maps a Multifile's contents into the
  26. // VirtualFileSystem.
  27. ////////////////////////////////////////////////////////////////////
  28. class EXPCL_PANDAEXPRESS VirtualFileMountMultifile : public VirtualFileMount {
  29. public:
  30. INLINE VirtualFileMountMultifile(VirtualFileSystem *file_system,
  31. Multifile *multifile,
  32. const Filename &mount_point,
  33. int mount_flags);
  34. virtual ~VirtualFileMountMultifile();
  35. INLINE Multifile *get_multifile() const;
  36. virtual bool has_file(const Filename &file) const;
  37. virtual bool is_directory(const Filename &file) const;
  38. virtual bool is_regular_file(const Filename &file) const;
  39. virtual istream *open_read_file(const Filename &file) const;
  40. virtual bool scan_directory(vector_string &contents,
  41. const Filename &dir) const;
  42. private:
  43. Multifile *_multifile;
  44. public:
  45. virtual TypeHandle get_type() const {
  46. return get_class_type();
  47. }
  48. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  49. static TypeHandle get_class_type() {
  50. return _type_handle;
  51. }
  52. static void init_type() {
  53. VirtualFileMount::init_type();
  54. register_type(_type_handle, "VirtualFileMountMultifile",
  55. VirtualFileMount::get_class_type());
  56. }
  57. private:
  58. static TypeHandle _type_handle;
  59. };
  60. #include "virtualFileMountMultifile.I"
  61. #endif