Panda3D
downloadDb.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 downloadDb.I
10  * @author shochet
11  * @date 2000-09-08
12  */
13 
14 /**
15  *
16  */
17 INLINE int DownloadDb::
18 get_client_num_multifiles() const {
19  return _client_db.get_num_multifiles();
20 }
21 
22 /**
23  *
24  */
25 INLINE int DownloadDb::
26 get_server_num_multifiles() const {
27  return _server_db.get_num_multifiles();
28 }
29 
30 /**
31  *
32  */
33 INLINE std::string DownloadDb::
34 get_client_multifile_name(int index) const {
35  return _client_db.get_multifile_name(index);
36 }
37 
38 /**
39  *
40  */
41 INLINE std::string DownloadDb::
42 get_server_multifile_name(int index) const {
43  return _server_db.get_multifile_name(index);
44 }
45 
46 
47 /**
48  *
49  */
50 INLINE Phase DownloadDb::
51 get_client_multifile_phase(std::string mfname) const {
52  return (_client_db.get_multifile_record_named(mfname))->_phase;
53 }
54 
55 /**
56  *
57  */
58 INLINE Phase DownloadDb::
59 get_server_multifile_phase(std::string mfname) const {
60  return (_server_db.get_multifile_record_named(mfname))->_phase;
61 }
62 
63 
64 
65 /**
66  *
67  */
68 INLINE int DownloadDb::
69 get_client_multifile_size(std::string mfname) const {
70  return (_client_db.get_multifile_record_named(mfname))->_size;
71 }
72 
73 /**
74  *
75  */
76 INLINE void DownloadDb::
77 set_client_multifile_size(std::string mfname, int size) {
78  (_client_db.get_multifile_record_named(mfname))->_size = size;
79  write_client_db(_client_db._filename);
80 }
81 
82 
83 /**
84  *
85  */
86 INLINE int DownloadDb::
87 set_client_multifile_delta_size(std::string mfname, int size) {
88  (_client_db.get_multifile_record_named(mfname))->_size += size;
89  write_client_db(_client_db._filename);
90  // Return the new total
91  return (_client_db.get_multifile_record_named(mfname))->_size;
92 }
93 
94 
95 
96 /**
97  *
98  */
99 INLINE int DownloadDb::
100 get_server_multifile_size(std::string mfname) const {
101  return (_server_db.get_multifile_record_named(mfname))->_size;
102 }
103 
104 
105 /**
106  *
107  */
108 INLINE void DownloadDb::
109 set_server_multifile_size(std::string mfname, int size) {
110  (_server_db.get_multifile_record_named(mfname))->_size = size;
111 }
112 
113 
114 /**
115  *
116  */
117 INLINE void DownloadDb::
118 set_client_multifile_incomplete(std::string mfname) {
119  (_client_db.get_multifile_record_named(mfname))->_status = Status_incomplete;
120  write_client_db(_client_db._filename);
121 }
122 
123 /**
124  *
125  */
126 INLINE void DownloadDb::
127 set_client_multifile_complete(std::string mfname) {
128  (_client_db.get_multifile_record_named(mfname))->_status = Status_complete;
129  write_client_db(_client_db._filename);
130 }
131 
132 /**
133  *
134  */
135 INLINE void DownloadDb::
136 set_client_multifile_decompressed(std::string mfname) {
137  (_client_db.get_multifile_record_named(mfname))->_status = Status_decompressed;
138  write_client_db(_client_db._filename);
139 }
140 
141 /**
142  *
143  */
144 INLINE void DownloadDb::
145 set_client_multifile_extracted(std::string mfname) {
146  (_client_db.get_multifile_record_named(mfname))->_status = Status_extracted;
147  write_client_db(_client_db._filename);
148 }
149 
150 /**
151  *
152  */
153 INLINE int DownloadDb::
154 get_server_num_files(std::string mfname) const {
155  return (_server_db.get_multifile_record_named(mfname))->get_num_files();
156 }
157 
158 /**
159  *
160  */
161 INLINE std::string DownloadDb::
162 get_server_file_name(std::string mfname, int index) const {
163  return (_server_db.get_multifile_record_named(mfname))->get_file_name(index);
164 }