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