Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
DownloadDb::Db Class Reference

## Public Member Functions
PT(MultifileRecord) get_multifile_record_named(std void | add_multifile_record (PT(MultifileRecord) mfr)
std::string | get_multifile_name (int index) const
int | get_num_multifiles () const
bool | multifile_exists (std::string mfname) const
int | parse_header (Datagram dg)
| Verifies magic number, returns the number of multifiles or -1 if invalid.
int | parse_record_header (Datagram dg)
| Parses a file record (fr) header and returns the length of the next file record.
| PT (FileRecord) parse_fr(Datagram dg)
| PT (MultifileRecord) parse_mfr(Datagram dg)
bool | read (StreamReader &sr, bool want_server_info)
void | write (std::ostream &out) const
bool | write (StreamWriter &sw, bool want_server_info)
bool | write_bogus_header (StreamWriter &sw)
| Writes the bogus header uncompressed with platform- independent byte ordering.
bool | write_header (std::ostream &write_stream)
| Writes the header uncompressed with platform- independent byte ordering.

## Public Attributes
Filename | _filename
MultifileRecords | _mfile_records

## Detailed Description

Definition at line 165 of file downloadDb.h.

## Constructor & Destructor Documentation

## ◆ Db()

DownloadDb::Db::Db | ( |  | ) |

Definition at line 511 of file downloadDb.cxx.

## Member Function Documentation

## ◆ add_multifile_record()

void DownloadDb::Db::add_multifile_record | ( | PT(MultifileRecord) | mfr | ) |

Definition at line 582 of file downloadDb.cxx.

## ◆ get_multifile_name()

string DownloadDb::Db::get_multifile_name | ( | int | index | ) | const

Definition at line 541 of file downloadDb.cxx.

## ◆ get_num_multifiles()

int DownloadDb::Db::get_num_multifiles | ( |  | ) | const

Definition at line 533 of file downloadDb.cxx.

## ◆ multifile_exists()

bool DownloadDb::Db::multifile_exists | ( | std::string | mfname | ) | const

Definition at line 549 of file downloadDb.cxx.

## ◆ parse_header()

int DownloadDb::Db::parse_header | ( | Datagram | dg | ) |

Verifies magic number, returns the number of multifiles or -1 if invalid.

Definition at line 591 of file downloadDb.cxx.

References DatagramIterator::get_int32(), and DatagramIterator::get_uint32().

## ◆ parse_record_header()

int DownloadDb::Db::parse_record_header | ( | Datagram | dg | ) |

Parses a file record (fr) header and returns the length of the next file record.

Definition at line 629 of file downloadDb.cxx.

References DatagramIterator::get_int32().

## ◆ read()

bool DownloadDb::Db::read | ( | StreamReader & | sr,
|  | bool | want_server_info )

Definition at line 705 of file downloadDb.cxx.

## ◆ write() [1/2]

void DownloadDb::Db::write | ( | std::ostream & | out | ) | const

Definition at line 521 of file downloadDb.cxx.

## ◆ write() [2/2]

bool DownloadDb::Db::write | ( | StreamWriter & | sw,
|  | bool | want_server_info )

Definition at line 798 of file downloadDb.cxx.

## ◆ write_bogus_header()

bool DownloadDb::Db::write_bogus_header | ( | StreamWriter & | sw | ) |

Writes the bogus header uncompressed with platform- independent byte ordering.

This header will get overwritten with the real magic number as the last step in the write

Definition at line 877 of file downloadDb.cxx.

References StreamWriter::add_int32(), and StreamWriter::add_uint32().

## ◆ write_header()

bool DownloadDb::Db::write_header | ( | std::ostream & | write_stream | ) |

Writes the header uncompressed with platform- independent byte ordering.

Definition at line 891 of file downloadDb.cxx.

References Datagram::add_int32(), Datagram::add_uint32(), Datagram::get_data(), and Datagram::get_length().

## Member Data Documentation

## ◆ _filename

Filename DownloadDb::Db::_filename

Definition at line 180 of file downloadDb.h.

## ◆ _mfile_records

MultifileRecords DownloadDb::Db::_mfile_records

Definition at line 181 of file downloadDb.h.

The documentation for this class was generated from the following files:

- panda/src/downloader/downloadDb.h
- panda/src/downloader/downloadDb.cxx