Organize and analyze the name of a log or telemetry file. More...
#include <logFileName.hpp>
Public Member Functions | |
logFileName () | |
Default c'tor. More... | |
logFileName (const std::string &fullName) | |
Construct from a full name. More... | |
int | fullName (const std::string &fullName) |
Sets the full name. More... | |
logFileName & | operator= (const std::string &fullName) |
Assignment operator from string. More... | |
std::string | fullName () const |
Get the current value of m_fullName. More... | |
std::string | baseName () const |
Get the current value of m_baseName. More... | |
std::string | appName () const |
Get the current value of m_appName. More... | |
int | year () const |
Get the current value of m_year. More... | |
int | month () const |
Get the current value of m_month. More... | |
int | day () const |
Get the current value of m_day. More... | |
int | hour () const |
Get the current value of m_hour. More... | |
int | minute () const |
Get the current value of m_minute. More... | |
int | second () const |
Get the current value of m_second. More... | |
int | nsec () const |
Get the current value of m_nsec. More... | |
flatlogs::timespecX | timestamp () const |
Get the current value of m_valid. More... | |
std::string | extension () const |
Get the current value of. More... | |
bool | valid () const |
Get the current value of. More... | |
Protected Member Functions | |
int | parseName () |
Parses the m_fullName and populates all fields. More... | |
Protected Attributes | |
std::string | m_fullName |
The full name of the file, including path. More... | |
std::string | m_baseName |
The base name of the file, not including path. More... | |
std::string | m_appName |
The name of the application which wrote the file. More... | |
int | m_year {0} |
The year of the timestamp. More... | |
int | m_month {0} |
The month of the timestamp. More... | |
int | m_day {0} |
The day of the timestamp. More... | |
int | m_hour {0} |
The hour of the timestamp. More... | |
int | m_minute {0} |
The minute of the timestamp. More... | |
int | m_second {0} |
The second of the timestamp. More... | |
int | m_nsec {0} |
The nanosecond of the timestamp. More... | |
flatlogs::timespecX | m_timestamp {0,0} |
The timestamp. More... | |
std::string | m_extension |
The extension of the file. More... | |
bool | m_valid {false} |
Whether or not the file parsed correctly and the components are valid. More... | |
Organize and analyze the name of a log or telemetry file.
Definition at line 28 of file logFileName.hpp.
MagAOX::logger::logFileName::logFileName | ( | ) |
Default c'tor.
Definition at line 16 of file logFileName.cpp.
|
explicit |
Construct from a full name.
This calls parseName, which parses the input and populates all fields.
On success, sets m_valid=true
On error, sets m_valid=false
[in] | fullName | The new full name of the log (including the path) |
Definition at line 21 of file logFileName.cpp.
std::string MagAOX::logger::logFileName::appName | ( | ) | const |
Get the current value of m_appName.
Definition at line 49 of file logFileName.cpp.
Referenced by MagAOX::logger::logMap::loadAppToFileMap().
std::string MagAOX::logger::logFileName::baseName | ( | ) | const |
Get the current value of m_baseName.
Definition at line 44 of file logFileName.cpp.
Referenced by MagAOX::logger::compLogFileName::operator()().
int MagAOX::logger::logFileName::day | ( | ) | const |
Get the current value of m_day.
Definition at line 64 of file logFileName.cpp.
std::string MagAOX::logger::logFileName::extension | ( | ) | const |
Get the current value of.
Definition at line 94 of file logFileName.cpp.
std::string MagAOX::logger::logFileName::fullName | ( | ) | const |
Get the current value of m_fullName.
Definition at line 39 of file logFileName.cpp.
Referenced by operator=().
int MagAOX::logger::logFileName::fullName | ( | const std::string & | fullName | ) |
Sets the full name.
Setting the full name is the only way to set any of the values. This parses the input and populates all fields.
m_valid=true
m_valid=false
[in] | fullName | The new full name of the log (including the path) |
Definition at line 26 of file logFileName.cpp.
Referenced by MagAOX::logger::logInMemory::loadFile().
int MagAOX::logger::logFileName::hour | ( | ) | const |
Get the current value of m_hour.
Definition at line 69 of file logFileName.cpp.
int MagAOX::logger::logFileName::minute | ( | ) | const |
Get the current value of m_minute.
Definition at line 74 of file logFileName.cpp.
int MagAOX::logger::logFileName::month | ( | ) | const |
Get the current value of m_month.
Definition at line 59 of file logFileName.cpp.
int MagAOX::logger::logFileName::nsec | ( | ) | const |
Get the current value of m_nsec.
Definition at line 84 of file logFileName.cpp.
logFileName & MagAOX::logger::logFileName::operator= | ( | const std::string & | fullName | ) |
Assignment operator from string.
Sets the full name, which is the only way to set any of the values. This parses the input and populates all fields.
On success, sets m_valid=true
On error, sets m_valid=false
this
[in] | fullName | The new full name of the log (including the path) |
Definition at line 32 of file logFileName.cpp.
|
protected |
Parses the m_fullName
and populates all fields.
m_valid=true
m_valid=false
Definition at line 104 of file logFileName.cpp.
Referenced by logFileName(), and fullName().
int MagAOX::logger::logFileName::second | ( | ) | const |
Get the current value of m_second.
Definition at line 79 of file logFileName.cpp.
flatlogs::timespecX MagAOX::logger::logFileName::timestamp | ( | ) | const |
Get the current value of m_valid.
Definition at line 89 of file logFileName.cpp.
bool MagAOX::logger::logFileName::valid | ( | ) | const |
Get the current value of.
Definition at line 99 of file logFileName.cpp.
int MagAOX::logger::logFileName::year | ( | ) | const |
Get the current value of m_year.
Definition at line 54 of file logFileName.cpp.
|
protected |
The name of the application which wrote the file.
Definition at line 35 of file logFileName.hpp.
Referenced by appName(), and parseName().
|
protected |
The base name of the file, not including path.
Definition at line 33 of file logFileName.hpp.
Referenced by baseName(), and parseName().
|
protected |
The day of the timestamp.
Definition at line 38 of file logFileName.hpp.
Referenced by day(), and parseName().
|
protected |
The extension of the file.
Definition at line 46 of file logFileName.hpp.
Referenced by extension(), and parseName().
|
protected |
The full name of the file, including path.
Definition at line 32 of file logFileName.hpp.
Referenced by fullName(), and parseName().
|
protected |
The hour of the timestamp.
Definition at line 39 of file logFileName.hpp.
Referenced by hour(), and parseName().
|
protected |
The minute of the timestamp.
Definition at line 40 of file logFileName.hpp.
Referenced by minute(), and parseName().
|
protected |
The month of the timestamp.
Definition at line 37 of file logFileName.hpp.
Referenced by month(), and parseName().
|
protected |
The nanosecond of the timestamp.
Definition at line 42 of file logFileName.hpp.
Referenced by nsec(), and parseName().
|
protected |
The second of the timestamp.
Definition at line 41 of file logFileName.hpp.
Referenced by parseName(), and second().
|
protected |
The timestamp.
Definition at line 44 of file logFileName.hpp.
Referenced by parseName(), and timestamp().
|
protected |
Whether or not the file parsed correctly and the components are valid.
Definition at line 48 of file logFileName.hpp.
Referenced by parseName(), and valid().
|
protected |
The year of the timestamp.
Definition at line 36 of file logFileName.hpp.
Referenced by parseName(), and year().