feisty meow concerns codebase
2.140
|
describes one portion of an ongoing file transfer. More...
#include <heavy_file_ops.h>
Public Member Functions | |
DEFINE_CLASS_NAME ("file_transfer_header") | |
file_transfer_header (const file_time &time_stamp) | |
refactored to force addition of the time_stamp. More... | |
virtual void | pack (basis::byte_array &packed_form) const |
Creates a packed form of the packable object in "packed_form". More... | |
virtual bool | unpack (basis::byte_array &packed_form) |
Restores the packable from the "packed_form". More... | |
virtual int | packed_size () const |
Estimates the space needed for the packed structure. More... | |
basis::astring | text_form () const |
basis::astring | readable_text_form () const |
a nicer formatting of the information. More... | |
Public Attributes | |
basis::astring | _filename |
the name of the file being transferred. More... | |
double | _byte_start |
the starting location in the file being sent. More... | |
int | _length |
the length of the transferred piece. More... | |
file_time | _time |
the timestamp on the file. More... | |
describes one portion of an ongoing file transfer.
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 29 of file heavy_file_ops.h.
filesystem::file_transfer_header::file_transfer_header | ( | const file_time & | time_stamp | ) |
refactored to force addition of the time_stamp.
Definition at line 44 of file heavy_file_ops.cpp.
filesystem::file_transfer_header::DEFINE_CLASS_NAME | ( | "file_transfer_header" | ) |
|
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 basis::packable.
Definition at line 70 of file heavy_file_ops.cpp.
References _byte_start, _filename, _length, _time, basis::attach(), filesystem::file_time::pack(), and basis::astring::pack().
Referenced by filesystem::heavy_file_operations::buffer_files().
|
virtual |
Estimates the space needed for the packed structure.
Implements basis::packable.
Definition at line 87 of file heavy_file_ops.cpp.
References _byte_start, _filename, _time, basis::attach(), basis::array< contents >::length(), basis::astring::length(), and filesystem::file_time::packed_size().
Referenced by filesystem::heavy_file_operations::buffer_files().
astring filesystem::file_transfer_header::readable_text_form | ( | ) | const |
a nicer formatting of the information.
Definition at line 61 of file heavy_file_ops.cpp.
References _filename, _length, _time, and filesystem::file_time::readable_text_form().
Referenced by octopi::recursive_file_copy::copy_hierarchy().
astring filesystem::file_transfer_header::text_form | ( | ) | const |
Definition at line 52 of file heavy_file_ops.cpp.
References _byte_start, _filename, _length, _time, and filesystem::file_time::text_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 basis::packable.
Definition at line 78 of file heavy_file_ops.cpp.
References _byte_start, _filename, _length, _time, basis::detach(), filesystem::file_time::unpack(), and basis::astring::unpack().
Referenced by octopi::recursive_file_copy::copy_hierarchy().
double filesystem::file_transfer_header::_byte_start |
the starting location in the file being sent.
Definition at line 34 of file heavy_file_ops.h.
Referenced by filesystem::heavy_file_operations::buffer_files(), pack(), packed_size(), text_form(), and unpack().
basis::astring filesystem::file_transfer_header::_filename |
the name of the file being transferred.
Definition at line 32 of file heavy_file_ops.h.
Referenced by filesystem::heavy_file_operations::buffer_files(), pack(), packed_size(), readable_text_form(), text_form(), and unpack().
int filesystem::file_transfer_header::_length |
the length of the transferred piece.
Definition at line 35 of file heavy_file_ops.h.
Referenced by filesystem::heavy_file_operations::buffer_files(), octopi::recursive_file_copy::copy_hierarchy(), pack(), readable_text_form(), text_form(), and unpack().
file_time filesystem::file_transfer_header::_time |
the timestamp on the file.
Definition at line 36 of file heavy_file_ops.h.
Referenced by filesystem::heavy_file_operations::buffer_files(), pack(), packed_size(), readable_text_form(), text_form(), and unpack().