feisty meow concerns codebase  2.140
filesystem::file_transfer_header Class Reference

describes one portion of an ongoing file transfer. More...

#include <heavy_file_ops.h>

Inheritance diagram for filesystem::file_transfer_header:
Collaboration diagram for filesystem::file_transfer_header:

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ file_transfer_header()

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.

Member Function Documentation

◆ DEFINE_CLASS_NAME()

filesystem::file_transfer_header::DEFINE_CLASS_NAME ( "file_transfer_header"  )

◆ pack()

void filesystem::file_transfer_header::pack ( basis::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 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().

◆ packed_size()

int filesystem::file_transfer_header::packed_size ( ) const
virtual

◆ readable_text_form()

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().

◆ text_form()

astring filesystem::file_transfer_header::text_form ( ) const

◆ unpack()

bool filesystem::file_transfer_header::unpack ( basis::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 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().

Member Data Documentation

◆ _byte_start

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().

◆ _filename

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().

◆ _length

int filesystem::file_transfer_header::_length

◆ _time

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().


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