Panda3D
 All Classes Functions Variables Enumerations
subfileInfo.h
1 // Filename: subfileInfo.h
2 // Created by: drose (20Jun11)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef SUBFILEINFO_H
16 #define SUBFILEINFO_H
17 
18 #include "pandabase.h"
19 #include "fileReference.h"
20 #include "pointerTo.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : SubfileInfo
24 // Description : This class records a particular byte sub-range within
25 // an existing file on disk. Generally, the filename is
26 // understood as a physical file on disk, and not to be
27 // looked up via the vfs.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAEXPRESS SubfileInfo {
30 PUBLISHED:
31  INLINE SubfileInfo();
32  INLINE SubfileInfo(const FileReference *file, streampos start, streamsize size);
33  INLINE SubfileInfo(const Filename &filename, streampos start, streamsize size);
34  INLINE SubfileInfo(const SubfileInfo &copy);
35  INLINE void operator = (const SubfileInfo &copy);
36 
37  INLINE bool is_empty() const;
38 
39  INLINE const FileReference *get_file() const;
40  INLINE const Filename &get_filename() const;
41  INLINE streampos get_start() const;
42  INLINE streamsize get_size() const;
43 
44  void output(ostream &out) const;
45 
46 private:
47  CPT(FileReference) _file;
48  streampos _start;
49  streamsize _size;
50 };
51 
52 INLINE ostream &operator << (ostream &out, const SubfileInfo &info);
53 
54 #include "subfileInfo.I"
55 
56 #endif
Keeps a reference-counted pointer to a file on disk.
Definition: fileReference.h:29
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
This class records a particular byte sub-range within an existing file on disk.
Definition: subfileInfo.h:29