wex  v21.04.0
Public Member Functions | List of all members
wex::file_stat Class Reference

Adds is_ok to the stat base class, several methods to get/update on the stat members, and sync to sync the stat from disk. More...

#include <wex/stat.h>

Inherits stat.

Public Member Functions

 file_stat (const std::string &path=std::string())
 Default constructor. Calls sync.
 
const std::string get_creation_time (const std::string &format=MOD_TIME_FORMAT) const
 Returns the creation time. More...
 
const std::string get_modification_time (const std::string &format=MOD_TIME_FORMAT) const
 Returns the modification time. More...
 
bool is_ok () const
 Returns true if the stat is okay (last sync was okay).
 
bool is_readonly () const
 Returns true if this stat is readonly.
 
const auto & path () const
 Returns path.
 
bool sync ()
 Sets (syncs) this stat, returns result and keeps it in is_ok.
 
bool sync (const std::string &path)
 Sets the path member, then syncs.
 

Detailed Description

Adds is_ok to the stat base class, several methods to get/update on the stat members, and sync to sync the stat from disk.

Member Function Documentation

◆ get_creation_time()

const std::string wex::file_stat::get_creation_time ( const std::string &  format = MOD_TIME_FORMAT) const

Returns the creation time.

Parameters
formatthe format as used by std::put_time

◆ get_modification_time()

const std::string wex::file_stat::get_modification_time ( const std::string &  format = MOD_TIME_FORMAT) const

Returns the modification time.

Parameters
formatthe format as used by std::put_time