SpinParser  1.0
Typedefs | Functions
Timestamp.hpp File Reference

Provide formatted timestamp strings. More...

#include <boost/date_time.hpp>
Include dependency graph for Timestamp.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef boost::posix_time::ptime Timestamp::Time
 Data structure to jold time and date information.
 
typedef boost::posix_time::time_duration Timestamp::Duration
 

Functions

Time Timestamp::time ()
 Get the current time. More...
 
Time Timestamp::time (const int offset)
 Get the current time plus some offset into the furutre. More...
 
Time Timestamp::time (const std::string &timestamp)
 Get a time object from a formatted timestamp string. More...
 
bool Timestamp::isOlder (const Time &time, const int offset)
 Check whether the time object is older than a given number of seconds. More...
 
std::string Timestamp::timestamp (const Time &time)
 Retrieve a timestamp string for the specified time. More...
 
std::string Timestamp::timestamp ()
 Retrieve a timestamp string for the current time. More...
 

Detailed Description

Provide formatted timestamp strings.

Author
Finn Lasse Buessen

Function Documentation

◆ isOlder()

bool Timestamp::isOlder ( const Time time,
const int  offset 
)
inline

Check whether the time object is older than a given number of seconds.

Parameters
timeTime object.
offsetAge threshold in seconds.
Returns
bool Return true if the time object is older than the specified amount of seconds. Otherwise, return false.

◆ time() [1/3]

Time Timestamp::time ( )
inline

Get the current time.

Returns
Time Current time.

◆ time() [2/3]

Time Timestamp::time ( const int  offset)
inline

Get the current time plus some offset into the furutre.

Parameters
offsetOffset duration in seconds.
Returns
Time Current time plus offset.

◆ time() [3/3]

Time Timestamp::time ( const std::string &  timestamp)
inline

Get a time object from a formatted timestamp string.

Parameters
timestampFormatted timestamp string.
Returns
Time Time as described by the timestamp.

◆ timestamp() [1/2]

std::string Timestamp::timestamp ( )
inline

Retrieve a timestamp string for the current time.

Returns
std::string Timestamp string.

◆ timestamp() [2/2]

std::string Timestamp::timestamp ( const Time time)
inline

Retrieve a timestamp string for the specified time.

Parameters
timeSpecified time.
Returns
std::string Timestamp string.