110 if(ext == std::string::npos)
121 if(ts == std::string::npos)
130 if(ps == std::string::npos) ps = 0;
143 std::string tstamp =
m_fullName.substr(ts, ext-ts);
145 m_year = std::stoi(tstamp.substr(0,4));
146 m_month = std::stoi(tstamp.substr(4,2));
147 m_day = std::stoi(tstamp.substr(6,2));
148 m_hour = std::stoi(tstamp.substr(8,2));
149 m_minute = std::stoi(tstamp.substr(10,2));
150 m_second = std::stoi(tstamp.substr(12,2));
151 m_nsec = std::stoi(tstamp.substr(14,9));
154 tmst.tm_year =
m_year-1900;
156 tmst.tm_mday =
m_day;
Organize and analyze the name of a log or telemetry file.
int m_year
The year of the timestamp.
std::string extension() const
Get the current value of.
std::string m_extension
The extension of the file.
int m_minute
The minute of the timestamp.
int day() const
Get the current value of m_day.
int minute() const
Get the current value of m_minute.
int year() const
Get the current value of m_year.
flatlogs::timespecX m_timestamp
The timestamp.
int m_month
The month of the timestamp.
int parseName()
Parses the m_fullName and populates all fields.
bool m_valid
Whether or not the file parsed correctly and the components are valid.
int m_second
The second of the timestamp.
std::string m_appName
The name of the application which wrote the file.
std::string m_fullName
The full name of the file, including path.
flatlogs::timespecX timestamp() const
Get the current value of m_valid.
int m_day
The day of the timestamp.
std::string appName() const
Get the current value of m_appName.
logFileName()
Default c'tor.
int m_hour
The hour of the timestamp.
std::string m_baseName
The base name of the file, not including path.
int second() const
Get the current value of m_second.
int hour() const
Get the current value of m_hour.
int m_nsec
The nanosecond of the timestamp.
std::string fullName() const
Get the current value of m_fullName.
logFileName & operator=(const std::string &fullName)
Assignment operator from string.
int nsec() const
Get the current value of m_nsec.
std::string baseName() const
Get the current value of m_baseName.
bool valid() const
Get the current value of.
int month() const
Get the current value of m_month.
Declares and defines the logFileName class.
A fixed-width timespec structure.
nanosecT time_ns
Nanoseconds.
secT time_s
Time since the Unix epoch.