Panda3D
Loading...
Searching...
No Matches
virtualFileList.I
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 virtualFileList.I
10 * @author drose
11 * @date 2002-08-03
12 */
13
14/**
15 *
16 */
17INLINE VirtualFileList::
18VirtualFileList() {
19}
20
21/**
22 *
23 */
24INLINE VirtualFileList::
25~VirtualFileList() {
26}
27
28/**
29 * Adds a new file to the list.
30 */
32add_file(VirtualFile *file) {
33 _files.push_back(file);
34}
35
36/**
37 * Returns the number of files in the list.
38 */
39INLINE size_t VirtualFileList::
40get_num_files() const {
41 return _files.size();
42}
43
44/**
45 * Returns the nth file in the list.
46 */
48get_file(size_t n) const {
49 nassertr(n < _files.size(), nullptr);
50 return _files[n];
51}
52
53/**
54 * Returns the nth file in the list.
55 */
57operator [](size_t n) const {
58 nassertr(n < _files.size(), nullptr);
59 return _files[n];
60}
61
62/**
63 * Returns the number of files in the list.
64 */
65INLINE size_t VirtualFileList::
66size() const {
67 return _files.size();
68}
69
70/**
71 * Appends the other list onto the end of this one.
72 */
74operator += (const VirtualFileList &other) {
75 _files.insert(_files.end(), other._files.begin(), other._files.end());
76}
77
78/**
79 * Returns a VirtualFileList representing the concatenation of the two lists.
80 */
82operator + (const VirtualFileList &other) const {
83 VirtualFileList a(*this);
84 a += other;
85 return a;
86}
A list of VirtualFiles, as returned by VirtualFile::scan_directory().
get_file
Returns the nth file in the list.
size_t size() const
Returns the number of files in the list.
VirtualFileList operator+(const VirtualFileList &other) const
Returns a VirtualFileList representing the concatenation of the two lists.
void add_file(VirtualFile *file)
Adds a new file to the list.
get_num_files
Returns the number of files in the list.
VirtualFile * operator[](size_t n) const
Returns the nth file in the list.
void operator+=(const VirtualFileList &other)
Appends the other list onto the end of this one.
The abstract base class for a file or directory within the VirtualFileSystem.
Definition virtualFile.h:35