00001 // Filename: virtualFileList.I 00002 // Created by: drose (03Aug02) 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 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: VirtualFileList::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE VirtualFileList:: 00022 VirtualFileList() { 00023 } 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Function: VirtualFileList::Destructor 00027 // Access: Published 00028 // Description: 00029 //////////////////////////////////////////////////////////////////// 00030 INLINE VirtualFileList:: 00031 ~VirtualFileList() { 00032 } 00033 00034 //////////////////////////////////////////////////////////////////// 00035 // Function: VirtualFileList::add_file 00036 // Access: Public 00037 // Description: Adds a new file to the list. 00038 //////////////////////////////////////////////////////////////////// 00039 INLINE void VirtualFileList:: 00040 add_file(VirtualFile *file) { 00041 _files.push_back(file); 00042 } 00043 00044 //////////////////////////////////////////////////////////////////// 00045 // Function: VirtualFileList::get_num_files 00046 // Access: Published 00047 // Description: Returns the number of files in the list. 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE int VirtualFileList:: 00050 get_num_files() const { 00051 return _files.size(); 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: VirtualFileList::get_file 00056 // Access: Published 00057 // Description: Returns the nth file in the list. 00058 //////////////////////////////////////////////////////////////////// 00059 INLINE VirtualFile *VirtualFileList:: 00060 get_file(int n) const { 00061 nassertr(n >= 0 && n < (int)_files.size(), NULL); 00062 return _files[n]; 00063 } 00064 00065 //////////////////////////////////////////////////////////////////// 00066 // Function: VirtualFileList::operator [] 00067 // Access: Published 00068 // Description: Returns the nth file in the list. 00069 //////////////////////////////////////////////////////////////////// 00070 INLINE VirtualFile *VirtualFileList:: 00071 operator [](int n) const { 00072 nassertr(n >= 0 && n < (int)_files.size(), NULL); 00073 return _files[n]; 00074 } 00075 00076 //////////////////////////////////////////////////////////////////// 00077 // Function: VirtualFileList::size 00078 // Access: Published 00079 // Description: Returns the number of files in the list. 00080 //////////////////////////////////////////////////////////////////// 00081 INLINE int VirtualFileList:: 00082 size() const { 00083 return _files.size(); 00084 } 00085 00086 //////////////////////////////////////////////////////////////////// 00087 // Function: VirtualFileList::operator += 00088 // Access: Published 00089 // Description: Appends the other list onto the end of this one. 00090 //////////////////////////////////////////////////////////////////// 00091 INLINE void VirtualFileList:: 00092 operator += (const VirtualFileList &other) { 00093 _files.insert(_files.end(), other._files.begin(), other._files.end()); 00094 } 00095 00096 //////////////////////////////////////////////////////////////////// 00097 // Function: VirtualFileList::operator + 00098 // Access: Published 00099 // Description: Returns a VirtualFileList representing the 00100 // concatenation of the two lists. 00101 //////////////////////////////////////////////////////////////////// 00102 INLINE VirtualFileList VirtualFileList:: 00103 operator + (const VirtualFileList &other) const { 00104 VirtualFileList a(*this); 00105 a += other; 00106 return a; 00107 }