15 #include "pandabase.h" 19 #include "download_utils.h" 20 #include "config_downloader.h" 25 pifstream read_stream;
28 downloader_cat.error()
29 <<
"check_crc() - Failed to open input file: " << name << endl;
34 read_stream.seekg(0, ios::end);
35 int buffer_length = read_stream.tellg();
36 char *buffer =
new char[buffer_length];
37 read_stream.seekg(0, ios::beg);
38 read_stream.read(buffer, buffer_length);
41 unsigned long crc = crc32(0L, Z_NULL, 0);
42 crc = crc32(crc, (
unsigned char *)buffer, buffer_length);
51 pifstream read_stream;
54 downloader_cat.error()
55 <<
"check_adler() - Failed to open input file: " << name << endl;
60 read_stream.seekg(0, ios::end);
61 int buffer_length = read_stream.tellg();
62 char *buffer =
new char[buffer_length];
63 read_stream.seekg(0, ios::beg);
64 read_stream.read(buffer, buffer_length);
67 unsigned long adler = adler32(0L, Z_NULL, 0);
68 adler = adler32(adler, (
unsigned char *)buffer, buffer_length);
void set_binary()
Indicates that the filename represents a binary file.
bool open_read(ifstream &stream) const
Opens the indicated ifstream for reading the file, if possible.
The name of a file, such as a texture file or an Egg file.