Panda3D
|
00001 // Filename: subfileInfo.h 00002 // Created by: drose (20Jun11) 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 SUBFILEINFO_H 00016 #define SUBFILEINFO_H 00017 00018 #include "pandabase.h" 00019 #include "fileReference.h" 00020 #include "pointerTo.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : SubfileInfo 00024 // Description : This class records a particular byte sub-range within 00025 // an existing file on disk. Generally, the filename is 00026 // understood as a physical file on disk, and not to be 00027 // looked up via the vfs. 00028 //////////////////////////////////////////////////////////////////// 00029 class EXPCL_PANDAEXPRESS SubfileInfo { 00030 PUBLISHED: 00031 INLINE SubfileInfo(); 00032 INLINE SubfileInfo(const FileReference *file, streampos start, streamsize size); 00033 INLINE SubfileInfo(const Filename &filename, streampos start, streamsize size); 00034 INLINE SubfileInfo(const SubfileInfo ©); 00035 INLINE void operator = (const SubfileInfo ©); 00036 00037 INLINE bool is_empty() const; 00038 00039 INLINE const FileReference *get_file() const; 00040 INLINE const Filename &get_filename() const; 00041 INLINE streampos get_start() const; 00042 INLINE streamsize get_size() const; 00043 00044 void output(ostream &out) const; 00045 00046 private: 00047 CPT(FileReference) _file; 00048 streampos _start; 00049 streamsize _size; 00050 }; 00051 00052 INLINE ostream &operator << (ostream &out, const SubfileInfo &info); 00053 00054 #include "subfileInfo.I" 00055 00056 #endif