Panda3D
 All Classes Functions Variables Enumerations
downloadDb.I
1 // Filename: downloadDb.I
2 // Created by: shochet (08Sep00)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: DownloadDb::
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE int DownloadDb::
22 get_client_num_multifiles() const {
23  return _client_db.get_num_multifiles();
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: DownloadDb::
28 // Access: Public
29 // Description:
30 ////////////////////////////////////////////////////////////////////
31 INLINE int DownloadDb::
32 get_server_num_multifiles() const {
33  return _server_db.get_num_multifiles();
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: DownloadDb::
38 // Access: Public
39 // Description:
40 ////////////////////////////////////////////////////////////////////
41 INLINE string DownloadDb::
42 get_client_multifile_name(int index) const {
43  return _client_db.get_multifile_name(index);
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: DownloadDb::
48 // Access: Public
49 // Description:
50 ////////////////////////////////////////////////////////////////////
51 INLINE string DownloadDb::
52 get_server_multifile_name(int index) const {
53  return _server_db.get_multifile_name(index);
54 }
55 
56 
57 ////////////////////////////////////////////////////////////////////
58 // Function: DownloadDb::
59 // Access: Public
60 // Description:
61 ////////////////////////////////////////////////////////////////////
62 INLINE Phase DownloadDb::
63 get_client_multifile_phase(string mfname) const {
64  return (_client_db.get_multifile_record_named(mfname))->_phase;
65 }
66 
67 ////////////////////////////////////////////////////////////////////
68 // Function: DownloadDb::
69 // Access: Public
70 // Description:
71 ////////////////////////////////////////////////////////////////////
72 INLINE Phase DownloadDb::
73 get_server_multifile_phase(string mfname) const {
74  return (_server_db.get_multifile_record_named(mfname))->_phase;
75 }
76 
77 
78 
79 ////////////////////////////////////////////////////////////////////
80 // Function: DownloadDb::
81 // Access: Public
82 // Description:
83 ////////////////////////////////////////////////////////////////////
84 INLINE int DownloadDb::
85 get_client_multifile_size(string mfname) const {
86  return (_client_db.get_multifile_record_named(mfname))->_size;
87 }
88 
89 ////////////////////////////////////////////////////////////////////
90 // Function: DownloadDb::
91 // Access: Public
92 // Description:
93 ////////////////////////////////////////////////////////////////////
94 INLINE void DownloadDb::
95 set_client_multifile_size(string mfname, int size) {
96  (_client_db.get_multifile_record_named(mfname))->_size = size;
97  write_client_db(_client_db._filename);
98 }
99 
100 
101 ////////////////////////////////////////////////////////////////////
102 // Function: DownloadDb::
103 // Access: Public
104 // Description:
105 ////////////////////////////////////////////////////////////////////
106 INLINE int DownloadDb::
107 set_client_multifile_delta_size(string mfname, int size) {
108  (_client_db.get_multifile_record_named(mfname))->_size += size;
109  write_client_db(_client_db._filename);
110  // Return the new total
111  return (_client_db.get_multifile_record_named(mfname))->_size;
112 }
113 
114 
115 
116 ////////////////////////////////////////////////////////////////////
117 // Function: DownloadDb::
118 // Access: Public
119 // Description:
120 ////////////////////////////////////////////////////////////////////
121 INLINE int DownloadDb::
122 get_server_multifile_size(string mfname) const {
123  return (_server_db.get_multifile_record_named(mfname))->_size;
124 }
125 
126 
127 ////////////////////////////////////////////////////////////////////
128 // Function: DownloadDb::
129 // Access: Public
130 // Description:
131 ////////////////////////////////////////////////////////////////////
132 INLINE void DownloadDb::
133 set_server_multifile_size(string mfname, int size) {
134  (_server_db.get_multifile_record_named(mfname))->_size = size;
135 }
136 
137 
138 ////////////////////////////////////////////////////////////////////
139 // Function: DownloadDb::
140 // Access: Public
141 // Description:
142 ////////////////////////////////////////////////////////////////////
143 INLINE void DownloadDb::
144 set_client_multifile_incomplete(string mfname) {
145  (_client_db.get_multifile_record_named(mfname))->_status = Status_incomplete;
146  write_client_db(_client_db._filename);
147 }
148 
149 ////////////////////////////////////////////////////////////////////
150 // Function: DownloadDb::
151 // Access: Public
152 // Description:
153 ////////////////////////////////////////////////////////////////////
154 INLINE void DownloadDb::
155 set_client_multifile_complete(string mfname) {
156  (_client_db.get_multifile_record_named(mfname))->_status = Status_complete;
157  write_client_db(_client_db._filename);
158 }
159 
160 ////////////////////////////////////////////////////////////////////
161 // Function: DownloadDb::
162 // Access: Public
163 // Description:
164 ////////////////////////////////////////////////////////////////////
165 INLINE void DownloadDb::
166 set_client_multifile_decompressed(string mfname) {
167  (_client_db.get_multifile_record_named(mfname))->_status = Status_decompressed;
168  write_client_db(_client_db._filename);
169 }
170 
171 ////////////////////////////////////////////////////////////////////
172 // Function: DownloadDb::
173 // Access: Public
174 // Description:
175 ////////////////////////////////////////////////////////////////////
176 INLINE void DownloadDb::
177 set_client_multifile_extracted(string mfname) {
178  (_client_db.get_multifile_record_named(mfname))->_status = Status_extracted;
179  write_client_db(_client_db._filename);
180 }
181 
182 ////////////////////////////////////////////////////////////////////
183 // Function: DownloadDb::
184 // Access: Public
185 // Description:
186 ////////////////////////////////////////////////////////////////////
187 INLINE int DownloadDb::
188 get_server_num_files(string mfname) const {
189  return (_server_db.get_multifile_record_named(mfname))->get_num_files();
190 }
191 
192 ////////////////////////////////////////////////////////////////////
193 // Function: DownloadDb::
194 // Access: Public
195 // Description:
196 ////////////////////////////////////////////////////////////////////
197 INLINE string DownloadDb::
198 get_server_file_name(string mfname, int index) const {
199  return (_server_db.get_multifile_record_named(mfname))->get_file_name(index);
200 }