Panda3D
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. More...
 
int parse_record_header (Datagram dg)
 Parses a file record (fr) header and returns the length of the next file record. More...
 
 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. More...
 
bool write_header (std::ostream &write_stream)
 Writes the header uncompressed with platform- independent byte ordering. More...
 

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 512 of file downloadDb.cxx.

Member Function Documentation

◆ get_multifile_name()

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

Definition at line 542 of file downloadDb.cxx.

◆ get_num_multifiles()

int DownloadDb::Db::get_num_multifiles ( ) const

Definition at line 534 of file downloadDb.cxx.

◆ multifile_exists()

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

Definition at line 550 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 592 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 630 of file downloadDb.cxx.

References DatagramIterator::get_int32().

◆ read()

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

Definition at line 706 of file downloadDb.cxx.

◆ write() [1/2]

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

Definition at line 522 of file downloadDb.cxx.

◆ write() [2/2]

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

Definition at line 799 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 878 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 892 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: