32 typedef PN_stdfloat Phase;
68 Status_incomplete = 0,
70 Status_decompressed = 2,
79 void output(std::ostream &out)
const;
80 void write(std::ostream &out)
const;
81 void write_version_map(std::ostream &out)
const;
84 bool write_client_db(
Filename &file);
85 bool write_server_db(
Filename &file);
87 INLINE
int get_client_num_multifiles()
const;
88 INLINE
int get_server_num_multifiles()
const;
90 INLINE std::string get_client_multifile_name(
int index)
const;
91 INLINE std::string get_server_multifile_name(
int index)
const;
93 INLINE
int get_client_multifile_size(std::string mfname)
const;
94 INLINE
void set_client_multifile_size(std::string mfname,
int size);
95 INLINE
int set_client_multifile_delta_size(std::string mfname,
int size);
96 INLINE
int get_server_multifile_size(std::string mfname)
const;
97 INLINE
void set_server_multifile_size(std::string mfname,
int size);
99 INLINE Phase get_client_multifile_phase(std::string mfname)
const;
100 INLINE Phase get_server_multifile_phase(std::string mfname)
const;
102 INLINE
void set_client_multifile_incomplete(std::string mfname);
103 INLINE
void set_client_multifile_complete(std::string mfname);
104 INLINE
void set_client_multifile_decompressed(std::string mfname);
105 INLINE
void set_client_multifile_extracted(std::string mfname);
107 INLINE
int get_server_num_files(std::string mfname)
const;
108 INLINE std::string get_server_file_name(std::string mfname,
int index)
const;
111 bool client_multifile_exists(std::string mfname)
const;
112 bool client_multifile_complete(std::string mfname)
const;
113 bool client_multifile_decompressed(std::string mfname)
const;
114 bool client_multifile_extracted(std::string mfname)
const;
117 HashVal get_client_multifile_hash(std::string mfname)
const;
118 void set_client_multifile_hash(std::string mfname,
HashVal val);
119 HashVal get_server_multifile_hash(std::string mfname)
const;
120 void set_server_multifile_hash(std::string mfname,
HashVal val);
123 void delete_client_multifile(std::string mfname);
124 void add_client_multifile(std::string server_mfname);
125 void expand_client_multifile(std::string mfname);
128 void create_new_server_db();
129 void server_add_multifile(std::string mfname, Phase phase,
int size,
int status);
130 void server_add_file(std::string mfname, std::string fname);
138 void write(std::ostream &out)
const;
148 void write(std::ostream &out)
const;
149 int get_num_files()
const;
150 std::string get_file_name(
int index)
const;
151 bool file_exists(std::string fname)
const;
152 PT(
FileRecord) get_file_record_named(std::string fname)
const;
165 class EXPCL_PANDA_DOWNLOADER
Db {
168 void write(std::ostream &out)
const;
169 int get_num_multifiles()
const;
170 std::string get_multifile_name(
int index)
const;
171 bool multifile_exists(std::string mfname)
const;
172 PT(
MultifileRecord) get_multifile_record_named(std::string mfname)
const;
175 int parse_record_header(
Datagram dg);
182 bool write_header(std::ostream &write_stream);
185 int32_t _header_length;
189 Db read_db(
Filename &file,
bool want_server_info);
190 Db read_db(
Ramfile &file,
bool want_server_info);
191 bool write_db(
Filename &file,
Db db,
bool want_server_info);
200 static uint32_t _magic_number;
201 static uint32_t _bogus_magic_number;
206 void add_version(
const Filename &name,
const HashVal &hash,
int version);
208 bool has_version(
const Filename &name)
const;
209 int get_num_versions(
const Filename &name)
const;
210 void set_num_versions(
const Filename &name,
int num_versions);
221 INLINE std::ostream &operator << (std::ostream &out,
const DownloadDb &dldb) {
A StreamWriter object is used to write sequential binary data directly to an ostream.
A listing of files within multifiles for management of client-side synchronization with a server-prov...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Stores a 128-bit value that represents the hashed contents (typically MD5) of a file or buffer.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The name of a file, such as a texture file or an Egg file.
An in-memory buffer specifically designed for downloading files to memory.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for all things that want to be reference-counted.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to read sequential binary data directly from an istream.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...