Panda3D

Loading...
Searching...
No Matches
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 */
17INLINE int DownloadDb::
18get_client_num_multifiles() const {
19 return _client_db.get_num_multifiles();
20}
21
22/**
23 *
24 */
25INLINE int DownloadDb::
26get_server_num_multifiles() const {
27 return _server_db.get_num_multifiles();
28}
29
30/**
31 *
32 */
33INLINE std::string DownloadDb::
34get_client_multifile_name(int index) const {
35 return _client_db.get_multifile_name(index);
36}
37
38/**
39 *
40 */
41INLINE std::string DownloadDb::
42get_server_multifile_name(int index) const {
43 return _server_db.get_multifile_name(index);
44}
45
46
47/**
48 *
49 */
50INLINE Phase DownloadDb::
51get_client_multifile_phase(std::string mfname) const {
52 return (_client_db.get_multifile_record_named(mfname))->_phase;
53}
54
55/**
56 *
57 */
58INLINE Phase DownloadDb::
59get_server_multifile_phase(std::string mfname) const {
60 return (_server_db.get_multifile_record_named(mfname))->_phase;
61}
62
63
64
65/**
66 *
67 */
68INLINE int DownloadDb::
69get_client_multifile_size(std::string mfname) const {
70 return (_client_db.get_multifile_record_named(mfname))->_size;
71}
72
73/**
74 *
75 */
76INLINE void DownloadDb::
77set_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 */
86INLINE int DownloadDb::
87set_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 */
99INLINE int DownloadDb::
100get_server_multifile_size(std::string mfname) const {
101 return (_server_db.get_multifile_record_named(mfname))->_size;
102}
103
104
105/**
106 *
107 */
108INLINE void DownloadDb::
109set_server_multifile_size(std::string mfname, int size) {
110 (_server_db.get_multifile_record_named(mfname))->_size = size;
111}
112
113
114/**
115 *
116 */
117INLINE void DownloadDb::
118set_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 */
126INLINE void DownloadDb::
127set_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 */
135INLINE void DownloadDb::
136set_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 */
144INLINE void DownloadDb::
145set_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 */
153INLINE int DownloadDb::
154get_server_num_files(std::string mfname) const {
155 return (_server_db.get_multifile_record_named(mfname))->get_num_files();
156}
157
158/**
159 *
160 */
161INLINE std::string DownloadDb::
162get_server_file_name(std::string mfname, int index) const {
163 return (_server_db.get_multifile_record_named(mfname))->get_file_name(index);
164}