14 #ifndef VIRTUALFILEHTTP_H
15 #define VIRTUALFILEHTTP_H
25 class VirtualFileMountHTTP;
32 class EXPCL_PANDA_DOWNLOADER VirtualFileHTTP :
public VirtualFile {
34 VirtualFileHTTP(VirtualFileMountHTTP *mount,
36 bool implicit_pz_file,
38 virtual ~VirtualFileHTTP();
41 virtual Filename get_filename()
const;
46 INLINE
bool is_implicit_pz_file()
const;
50 virtual std::streamsize
get_file_size(std::istream *stream)
const;
54 virtual bool read_file(vector_uchar &result,
bool auto_unwrap)
const;
57 bool fetch_file(std::ostream *buffer_stream)
const;
58 std::istream *return_file(std::istream *buffer_stream,
bool auto_unwrap)
const;
60 VirtualFileMountHTTP *_mount;
62 bool _implicit_pz_file;
65 PT(HTTPChannel) _channel;
69 return get_class_type();
71 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
79 static void init_type() {
80 VirtualFile::init_type();
82 VirtualFile::get_class_type());
The name of a file, such as a texture file or an Egg file.
TypeHandle is the identifier used to differentiate C++ class types.
A container for a URL, e.g.
A hierarchy of directories and files that appears to be one continuous file system,...
The abstract base class for a file or directory within the VirtualFileSystem.
virtual std::istream * open_read_file(bool auto_unwrap) const
Opens the file for reading.
virtual bool is_regular_file() const
Returns true if this file represents a regular file (and read_file() may be called),...
virtual bool has_file() const
Returns true if this file exists, false otherwise.
virtual bool is_directory() const
Returns true if this file represents a directory (and scan_directory() may be called),...
virtual bool was_read_successful() const
Call this method after a reading the istream returned by open_read_file() to completion.
std::string read_file(bool auto_unwrap) const
Returns the entire contents of the file as a string.
virtual time_t get_timestamp() const
Returns a time_t value that represents the time the file was last modified, to within whatever precis...
virtual std::streamsize get_file_size() const
Returns the current size on disk (or wherever it is) of the file before it has been opened.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.