feisty meow concerns codebase  2.140
filesystem::file_time Class Reference

#include <file_time.h>

Inheritance diagram for filesystem::file_time:
Collaboration diagram for filesystem::file_time:

Public Member Functions

 file_time ()
 sets up a bogus file_time object. More...
 
 file_time (FILE *the_FILE)
 sets up the file_time information given a the file stream of interest. More...
 
 file_time (const basis::astring &filename)
 this constructor operates on a file's name rather than a FILE stream. More...
 
 file_time (const time_t &init)
 starts the file_time with a particular "init" time. More...
 
virtual ~file_time ()
 
 DEFINE_CLASS_NAME ("file_time")
 
virtual void text_form (basis::base_string &time_string) const
 returns a definitive but sorta ugly version of the file's time. More...
 
virtual void readable_text_form (basis::base_string &time_string) const
 sets "time_string" to a human readable form of the file's time. More...
 
void reset (FILE *the_FILE)
 reacquires the time from a different FILE than constructed with. More...
 
void reset (const basis::astring &filename)
 parallel version of reset() takes a file name instead of a stream. More...
 
void reset (const time_t &init)
 parallel version of reset() takes a time_t instead of a stream. More...
 
time_t raw () const
 provides the OS version of the file's timestamp. More...
 
bool set_time (const basis::astring &filename)
 sets the time for the the "filename" to the currently held time. More...
 
virtual bool less_than (const basis::orderable &ft2) const
 
virtual bool equal_to (const basis::equalizable &ft2) const
 
virtual int packed_size () const
 
virtual void pack (basis::byte_array &packed_form) const
 
virtual bool unpack (basis::byte_array &packed_form)
 
- Public Member Functions inherited from basis::text_formable
virtual const char * class_name () const =0
 Returns the bare name of this class as a constant character pointer. More...
 
- Public Member Functions inherited from basis::equalizable
virtual bool operator== (const equalizable &s2) const
 the virtual method for object equality. More...
 
- Public Member Functions inherited from basis::orderable
virtual bool operator< (const orderable &s2) const
 the virtual method for object ordering. More...
 

Detailed Description

Definition at line 29 of file file_time.h.

Constructor & Destructor Documentation

◆ file_time() [1/4]

filesystem::file_time::file_time ( )

sets up a bogus file_time object.

Definition at line 41 of file file_time.cpp.

References reset().

◆ file_time() [2/4]

filesystem::file_time::file_time ( FILE *  the_FILE)

sets up the file_time information given a the file stream of interest.

If the stream is NULL_POINTER, then the file_time is set up with an invalid time.

Definition at line 43 of file file_time.cpp.

References reset().

◆ file_time() [3/4]

filesystem::file_time::file_time ( const basis::astring filename)

this constructor operates on a file's name rather than a FILE stream.

Definition at line 47 of file file_time.cpp.

References reset(), and basis::astring::s().

◆ file_time() [4/4]

filesystem::file_time::file_time ( const time_t &  init)

starts the file_time with a particular "init" time.

Definition at line 45 of file file_time.cpp.

◆ ~file_time()

filesystem::file_time::~file_time ( )
virtual

Definition at line 57 of file file_time.cpp.

Member Function Documentation

◆ DEFINE_CLASS_NAME()

filesystem::file_time::DEFINE_CLASS_NAME ( "file_time"  )

◆ equal_to()

bool filesystem::file_time::equal_to ( const basis::equalizable ft2) const
virtual

Implements basis::equalizable.

Definition at line 109 of file file_time.cpp.

◆ less_than()

bool filesystem::file_time::less_than ( const basis::orderable ft2) const
virtual

Implements basis::orderable.

Definition at line 102 of file file_time.cpp.

◆ pack()

void filesystem::file_time::pack ( basis::byte_array packed_form) const
virtual

◆ packed_size()

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

◆ raw()

time_t filesystem::file_time::raw ( ) const
inline

provides the OS version of the file's timestamp.

Definition at line 71 of file file_time.h.

Referenced by set_time().

◆ readable_text_form()

void filesystem::file_time::readable_text_form ( basis::base_string time_string) const
virtual

sets "time_string" to a human readable form of the file's time.

Definition at line 121 of file file_time.cpp.

References basis::base_string::assign(), and timely::now().

Referenced by filesystem::file_transfer_header::readable_text_form().

◆ reset() [1/3]

void filesystem::file_time::reset ( const basis::astring filename)

parallel version of reset() takes a file name instead of a stream.

Definition at line 71 of file file_time.cpp.

References reset(), and basis::astring::s().

◆ reset() [2/3]

void filesystem::file_time::reset ( const time_t &  init)

parallel version of reset() takes a time_t instead of a stream.

Definition at line 69 of file file_time.cpp.

◆ reset() [3/3]

void filesystem::file_time::reset ( FILE *  the_FILE)

reacquires the time from a different FILE than constructed with.

this also can connect a FILE to the file_time object after using the empty constructor. further, it can also be used to refresh a file's time to account for changes in its timestamp.

Definition at line 80 of file file_time.cpp.

References fileno, fstat, FUNCDEF, LOG, and stat.

Referenced by file_time(), and reset().

◆ set_time()

bool filesystem::file_time::set_time ( const basis::astring filename)

sets the time for the the "filename" to the currently held time.

Definition at line 59 of file file_time.cpp.

References raw(), and basis::astring::s().

Referenced by filesystem::heavy_file_operations::copy_file().

◆ text_form()

void filesystem::file_time::text_form ( basis::base_string time_string) const
virtual

returns a definitive but sorta ugly version of the file's time.

Implements basis::text_formable.

Definition at line 116 of file file_time.cpp.

References basis::base_string::assign(), and basis::text_formable::class_name().

Referenced by filesystem::heavy_file_operations::copy_file(), and filesystem::file_transfer_header::text_form().

◆ unpack()

bool filesystem::file_time::unpack ( basis::byte_array packed_form)
virtual

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