API
MagAOX::logger::logFileName Class Reference

Organize and analyze the name of a log or telemetry file. More...

#include <logFileName.hpp>

Collaboration diagram for MagAOX::logger::logFileName:
Collaboration graph

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...
 
logFileNameoperator= (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...
 

Detailed Description

Organize and analyze the name of a log or telemetry file.

Definition at line 28 of file logFileName.hpp.

Constructor & Destructor Documentation

◆ logFileName() [1/2]

MagAOX::logger::logFileName::logFileName ( )

Default c'tor.

Definition at line 16 of file logFileName.cpp.

◆ logFileName() [2/2]

MagAOX::logger::logFileName::logFileName ( const std::string &  fullName)
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

Parameters
[in]fullNameThe new full name of the log (including the path)

Definition at line 21 of file logFileName.cpp.

Member Function Documentation

◆ appName()

std::string MagAOX::logger::logFileName::appName ( ) const

Get the current value of m_appName.

Returns
the current value of m_appName

Definition at line 49 of file logFileName.cpp.

Referenced by MagAOX::logger::logMap::loadAppToFileMap().

◆ baseName()

std::string MagAOX::logger::logFileName::baseName ( ) const

Get the current value of m_baseName.

Returns
the current value of m_baseName

Definition at line 44 of file logFileName.cpp.

Referenced by MagAOX::logger::compLogFileName::operator()().

◆ day()

int MagAOX::logger::logFileName::day ( ) const

Get the current value of m_day.

Returns
the current value of m_day

Definition at line 64 of file logFileName.cpp.

◆ extension()

std::string MagAOX::logger::logFileName::extension ( ) const

Get the current value of.

Returns
the current value of

Definition at line 94 of file logFileName.cpp.

◆ fullName() [1/2]

std::string MagAOX::logger::logFileName::fullName ( ) const

Get the current value of m_fullName.

Returns
the current value of m_fullName

Definition at line 39 of file logFileName.cpp.

Referenced by operator=().

◆ fullName() [2/2]

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.

Returns
0 on sucess, and sets m_valid=true
-1 on an error, and sets m_valid=false
Parameters
[in]fullNameThe new full name of the log (including the path)

Definition at line 26 of file logFileName.cpp.

Referenced by MagAOX::logger::logInMemory::loadFile().

◆ hour()

int MagAOX::logger::logFileName::hour ( ) const

Get the current value of m_hour.

Returns
the current value of m_hour

Definition at line 69 of file logFileName.cpp.

◆ minute()

int MagAOX::logger::logFileName::minute ( ) const

Get the current value of m_minute.

Returns
the current value of m_minute

Definition at line 74 of file logFileName.cpp.

◆ month()

int MagAOX::logger::logFileName::month ( ) const

Get the current value of m_month.

Returns
the current value of m_month

Definition at line 59 of file logFileName.cpp.

◆ nsec()

int MagAOX::logger::logFileName::nsec ( ) const

Get the current value of m_nsec.

Returns
the current value of m_nsec

Definition at line 84 of file logFileName.cpp.

◆ operator=()

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

Returns
a reference the this
Parameters
[in]fullNameThe new full name of the log (including the path)

Definition at line 32 of file logFileName.cpp.

◆ parseName()

int MagAOX::logger::logFileName::parseName ( )
protected

Parses the m_fullName and populates all fields.

Returns
0 on sucess, and sets m_valid=true
-1 on an error, and sets m_valid=false

Definition at line 104 of file logFileName.cpp.

Referenced by logFileName(), and fullName().

◆ second()

int MagAOX::logger::logFileName::second ( ) const

Get the current value of m_second.

Returns
the current value of m_second

Definition at line 79 of file logFileName.cpp.

◆ timestamp()

flatlogs::timespecX MagAOX::logger::logFileName::timestamp ( ) const

Get the current value of m_valid.

Returns
the current value of m_valid

Definition at line 89 of file logFileName.cpp.

◆ valid()

bool MagAOX::logger::logFileName::valid ( ) const

Get the current value of.

Returns
the current value of

Definition at line 99 of file logFileName.cpp.

◆ year()

int MagAOX::logger::logFileName::year ( ) const

Get the current value of m_year.

Returns
the current value of m_year

Definition at line 54 of file logFileName.cpp.

Member Data Documentation

◆ m_appName

std::string MagAOX::logger::logFileName::m_appName
protected

The name of the application which wrote the file.

Definition at line 35 of file logFileName.hpp.

Referenced by appName(), and parseName().

◆ m_baseName

std::string MagAOX::logger::logFileName::m_baseName
protected

The base name of the file, not including path.

Definition at line 33 of file logFileName.hpp.

Referenced by baseName(), and parseName().

◆ m_day

int MagAOX::logger::logFileName::m_day {0}
protected

The day of the timestamp.

Definition at line 38 of file logFileName.hpp.

Referenced by day(), and parseName().

◆ m_extension

std::string MagAOX::logger::logFileName::m_extension
protected

The extension of the file.

Definition at line 46 of file logFileName.hpp.

Referenced by extension(), and parseName().

◆ m_fullName

std::string MagAOX::logger::logFileName::m_fullName
protected

The full name of the file, including path.

Definition at line 32 of file logFileName.hpp.

Referenced by fullName(), and parseName().

◆ m_hour

int MagAOX::logger::logFileName::m_hour {0}
protected

The hour of the timestamp.

Definition at line 39 of file logFileName.hpp.

Referenced by hour(), and parseName().

◆ m_minute

int MagAOX::logger::logFileName::m_minute {0}
protected

The minute of the timestamp.

Definition at line 40 of file logFileName.hpp.

Referenced by minute(), and parseName().

◆ m_month

int MagAOX::logger::logFileName::m_month {0}
protected

The month of the timestamp.

Definition at line 37 of file logFileName.hpp.

Referenced by month(), and parseName().

◆ m_nsec

int MagAOX::logger::logFileName::m_nsec {0}
protected

The nanosecond of the timestamp.

Definition at line 42 of file logFileName.hpp.

Referenced by nsec(), and parseName().

◆ m_second

int MagAOX::logger::logFileName::m_second {0}
protected

The second of the timestamp.

Definition at line 41 of file logFileName.hpp.

Referenced by parseName(), and second().

◆ m_timestamp

flatlogs::timespecX MagAOX::logger::logFileName::m_timestamp {0,0}
protected

The timestamp.

Definition at line 44 of file logFileName.hpp.

Referenced by parseName(), and timestamp().

◆ m_valid

bool MagAOX::logger::logFileName::m_valid {false}
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().

◆ m_year

int MagAOX::logger::logFileName::m_year {0}
protected

The year of the timestamp.

Definition at line 36 of file logFileName.hpp.

Referenced by parseName(), and year().


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