Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DownloadDb::Db Class Reference

#include <downloadDb.h>

List of all members.

Public Member Functions

 Db (void)
void write (ostream &out) const
int get_num_multifiles (void) const
string get_multifile_name (int index) const
bool multifile_exists (string mfname) const
PointerTo< MultifileRecordget_multifile_record_named (string mfname) const
void add_multifile_record (PointerTo< MultifileRecord > mfr)
int parse_header (uchar *start, int size)
 Verifies magic number, returns the number of multifiles or -1 if invalid.

int parse_record_header (uchar *start, int size)
 Parses a file record (fr) header and returns the length of the next file record.

PointerTo< MultifileRecordparse_mfr (uchar *start, int size)
 Parses a multifile record (mfr) and returns one.

PointerTo< FileRecordparse_fr (uchar *start, int size)
 Parses a file record (fr) and returns one.

bool read (istream &read_stream, bool want_server_info)
bool write (ofstream &write_stream, bool want_server_info)
bool write_header (ofstream &write_stream)
 Writes the header uncompressed with platform- independent byte ordering.

bool write_bogus_header (ofstream &write_stream)
 Writes the bogus header uncompressed with platform- independent byte ordering.


Public Attributes

Filename _filename
MultifileRecords _mfile_records

Private Attributes

PN_int32 _header_length
Datagram _datagram


Constructor & Destructor Documentation

DownloadDb::Db::Db void   ) 
 

Definition at line 663 of file downloadDb.cxx.

References _datagram, Datagram::append_data(), Datagram::clear(), DatagramIterator::get_uint32(), and PN_uint32.


Member Function Documentation

void DownloadDb::Db::add_multifile_record PointerTo< MultifileRecord mfr  ) 
 

Definition at line 757 of file downloadDb.cxx.

Referenced by DownloadDb::get_server_multifile_hash().

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

Definition at line 705 of file downloadDb.cxx.

References _datagram, Datagram::append_data(), and Datagram::clear().

Referenced by DownloadDb::get_client_multifile_name(), and DownloadDb::get_server_num_multifiles().

PointerTo< DownloadDb::MultifileRecord > DownloadDb::Db::get_multifile_record_named string  mfname  )  const
 

Definition at line 735 of file downloadDb.cxx.

References _datagram, and PN_int32.

Referenced by DownloadDb::client_multifile_complete(), DownloadDb::client_multifile_decompressed(), DownloadDb::get_client_multifile_phase(), DownloadDb::get_client_multifile_size(), DownloadDb::get_server_multifile_hash(), DownloadDb::get_server_multifile_name(), DownloadDb::get_server_multifile_phase(), DownloadDb::set_client_multifile_complete(), DownloadDb::set_client_multifile_decompressed(), DownloadDb::set_client_multifile_delta_size(), DownloadDb::set_client_multifile_incomplete(), and DownloadDb::set_client_multifile_size().

int DownloadDb::Db::get_num_multifiles void   )  const
 

Definition at line 693 of file downloadDb.cxx.

Referenced by DownloadDb::get_client_num_multifiles(), and write().

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

Definition at line 717 of file downloadDb.cxx.

References PN_int32.

PointerTo< DownloadDb::FileRecord > DownloadDb::Db::parse_fr uchar start,
int  size
 

Parses a file record (fr) and returns one.

Definition at line 893 of file downloadDb.cxx.

int DownloadDb::Db::parse_header uchar start,
int  size
 

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

Definition at line 773 of file downloadDb.cxx.

References _datagram, Datagram::append_data(), back_to_front_slash(), Datagram::clear(), DatagramIterator::extract_bytes(), DatagramIterator::get_int32(), PN_int32, and PT.

PointerTo< DownloadDb::MultifileRecord > DownloadDb::Db::parse_mfr uchar start,
int  size
 

Parses a multifile record (mfr) and returns one.

Definition at line 844 of file downloadDb.cxx.

References uchar.

int DownloadDb::Db::parse_record_header uchar start,
int  size
 

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

Definition at line 821 of file downloadDb.cxx.

bool DownloadDb::Db::read istream &  read_stream,
bool  want_server_info
 

Definition at line 927 of file downloadDb.cxx.

References _datagram.

bool DownloadDb::Db::write ofstream &  write_stream,
bool  want_server_info
 

Definition at line 1028 of file downloadDb.cxx.

References _datagram, Datagram::add_int32(), Datagram::add_uint32(), Datagram::clear(), Datagram::get_message(), and get_num_multifiles().

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

Definition at line 677 of file downloadDb.cxx.

Referenced by DownloadDb::~DownloadDb().

bool DownloadDb::Db::write_bogus_header ofstream &  write_stream  ) 
 

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

bool DownloadDb::Db::write_header ofstream &  write_stream  ) 
 

Writes the header uncompressed with platform- independent byte ordering.

Definition at line 1160 of file downloadDb.cxx.

References nassertv.


Member Data Documentation

Datagram DownloadDb::Db::_datagram [private]
 

Definition at line 208 of file downloadDb.h.

Referenced by Db(), get_multifile_name(), get_multifile_record_named(), parse_header(), read(), and write().

Filename DownloadDb::Db::_filename
 

Definition at line 200 of file downloadDb.h.

Referenced by DownloadDb::DownloadDb(), DownloadDb::get_client_multifile_size(), DownloadDb::get_server_multifile_phase(), DownloadDb::set_client_multifile_incomplete(), and DownloadDb::~DownloadDb().

PN_int32 DownloadDb::Db::_header_length [private]
 

Definition at line 205 of file downloadDb.h.

MultifileRecords DownloadDb::Db::_mfile_records
 

Definition at line 201 of file downloadDb.h.


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:49:29 2003 for Panda by doxygen1.3