CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <FileData.hh>
Interface class to check and/or store path and last_write_time of file on disk. Used to determine if files have been updated or deleted.
Definition at line 9 of file FileData.hh.
Public Member Functions | |
FileData (std::string const &_path, std::time_t _timestamp) | |
Construct with path and explicit timestamp. More... | |
FileData (std::string const &_path) | |
Construct with path, timestamp is set if file exists at path. More... | |
FileData () | |
default constructor More... | |
std::string const & | path () const |
return stored path More... | |
std::time_t | timestamp () const |
return stored timestamp. Timestamp corresponds to last_write_time of file timestamp defaults to 0 if file does not exist. More... | |
bool | up_to_date () const |
checks timestamp of file at path. Returns true if last_write_time of file matches timestamp returns false otherwise, or if file doesn't exist and stored timestamp is not zero (indicated file has been deleted) More... | |
bool | empty () const |
Returns true if path is empty. More... | |
bool | exists () const |
checks path for existing file. Does not alter stored timestamp More... | |
void | refresh () |
Updates timestamp using stored path. More... | |
bool | operator== (FileData const &other) const |
returns true if other FileData has same stored path and timestamp More... | |
Private Attributes | |
std::string | m_path |
std::time_t | m_timestamp |
|
inline |
Construct with path and explicit timestamp.
Definition at line 12 of file FileData.hh.
|
inline |
Construct with path, timestamp is set if file exists at path.
Definition at line 16 of file FileData.hh.
|
inline |
default constructor
Definition at line 21 of file FileData.hh.
|
inline |
Returns true if path is empty.
Definition at line 36 of file FileData.hh.
bool CASM::FileData::exists | ( | ) | const |
checks path for existing file. Does not alter stored timestamp
Definition at line 9 of file FileData.cc.
|
inline |
returns true if other FileData has same stored path and timestamp
Definition at line 45 of file FileData.hh.
|
inline |
return stored path
Definition at line 24 of file FileData.hh.
void CASM::FileData::refresh | ( | ) |
Updates timestamp using stored path.
Definition at line 11 of file FileData.cc.
|
inline |
return stored timestamp. Timestamp corresponds to last_write_time of file timestamp defaults to 0 if file does not exist.
Definition at line 28 of file FileData.hh.
|
inline |
checks timestamp of file at path. Returns true if last_write_time of file matches timestamp returns false otherwise, or if file doesn't exist and stored timestamp is not zero (indicated file has been deleted)
Definition at line 33 of file FileData.hh.
|
private |
Definition at line 51 of file FileData.hh.
|
private |
Definition at line 52 of file FileData.hh.