#include <heavy_file_ops.h>
Inheritance diagram for file_transfer_header:


Public Member Functions | |
| file_transfer_header () | |
| virtual void | pack (byte_array &packed_form) const |
| Creates a packed form of the packable object in "packed_form". | |
| virtual bool | unpack (byte_array &packed_form) |
| Restores the packable from the "packed_form". | |
| virtual int | packed_size () const |
| Estimates the space needed for the packed structure. | |
| istring | text_form () const |
Public Attributes | |
| istring | _filename |
| the name of the file being transferred. | |
| double | _byte_start |
| the starting location in the file being sent. | |
| int | _length |
| the length of the transferred piece. | |
this is just a header describing an attached byte package. it is expected that the bytes follow this in the communication stream.
Definition at line 99 of file heavy_file_ops.h.
| file_transfer_header::file_transfer_header | ( | ) |
Definition at line 35 of file heavy_file_ops.cpp.
| void file_transfer_header::pack | ( | byte_array & | packed_form | ) | const [virtual] |
Creates a packed form of the packable object in "packed_form".
This must append to the data in "packed_form" rather than clearing prior contents.
Implements packable.
Definition at line 48 of file heavy_file_ops.cpp.
References _byte_start, _filename, _length, basis::attach(), and istring::pack().
Referenced by heavy_file_operations::buffer_files().
| bool file_transfer_header::unpack | ( | byte_array & | packed_form | ) | [virtual] |
Restores the packable from the "packed_form".
This object becomes the unpacked form, and therefore must lose any of its prior contents that depend on the data in "packed_form". This is up to the derived unpack function to figure out. The "packed_form" is modified by extracting all of the pieces that are used for this object; the remainder stays in "packed_form". true is returned if the unpacking was successful.
Implements packable.
Definition at line 55 of file heavy_file_ops.cpp.
References _byte_start, _filename, _length, basis::detach(), and istring::unpack().
| int file_transfer_header::packed_size | ( | ) | const [virtual] |
Estimates the space needed for the packed structure.
Reimplemented from packable.
Definition at line 63 of file heavy_file_ops.cpp.
References _filename, and istring::length().
Referenced by heavy_file_operations::buffer_files().
| istring file_transfer_header::text_form | ( | ) | const |
the name of the file being transferred.
Definition at line 102 of file heavy_file_ops.h.
Referenced by advance(), heavy_file_operations::buffer_files(), pack(), packed_size(), text_form(), and unpack().
the starting location in the file being sent.
Definition at line 103 of file heavy_file_ops.h.
Referenced by advance(), heavy_file_operations::buffer_files(), pack(), text_form(), and unpack().
the length of the transferred piece.
Definition at line 104 of file heavy_file_ops.h.
Referenced by advance(), heavy_file_operations::buffer_files(), pack(), text_form(), and unpack().
1.5.1