26 pifstream read_stream;
29 downloader_cat.error()
30 <<
"check_crc() - Failed to open input file: " << name << std::endl;
35 read_stream.seekg(0, ios::end);
36 int buffer_length = read_stream.tellg();
37 char *buffer =
new char[buffer_length];
38 read_stream.seekg(0, ios::beg);
39 read_stream.read(buffer, buffer_length);
42 unsigned long crc = crc32(0L, Z_NULL, 0);
43 crc = crc32(crc, (
unsigned char *)buffer, buffer_length);
52 pifstream read_stream;
55 downloader_cat.error()
56 <<
"check_adler() - Failed to open input file: " << name << std::endl;
61 read_stream.seekg(0, ios::end);
62 int buffer_length = read_stream.tellg();
63 char *buffer =
new char[buffer_length];
64 read_stream.seekg(0, ios::beg);
65 read_stream.read(buffer, buffer_length);
68 unsigned long adler = adler32(0L, Z_NULL, 0);
69 adler = adler32(adler, (
unsigned char *)buffer, buffer_length);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_binary()
Indicates that the filename represents a binary file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool open_read(std::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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.