Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
JSYSTEM::JDateAndTime Class Reference

Auxililary class to get ASCII formatted date and time. More...

#include <JDate.hh>

Public Member Functions

 JDateAndTime ()
 Default constructor. More...
 
std::string toString () const
 Get ASCII formatted date and time. More...
 
std::string operator() () const
 Get ASCII formatted date and time. More...
 

Static Public Member Functions

static std::string toString (const time_t &ts)
 Get ASCII formatted date and time. More...
 

Private Attributes

time_t ts
 

Detailed Description

Auxililary class to get ASCII formatted date and time.

Definition at line 58 of file JDate.hh.

Constructor & Destructor Documentation

JSYSTEM::JDateAndTime::JDateAndTime ( )
inline

Default constructor.

Definition at line 64 of file JDate.hh.

65  {}

Member Function Documentation

std::string JSYSTEM::JDateAndTime::toString ( ) const
inline

Get ASCII formatted date and time.

Returns
date and time

Definition at line 73 of file JDate.hh.

74  {
75  time(&ts);
76 
77  return toString(ts);
78  }
std::string toString() const
Get ASCII formatted date and time.
Definition: JDate.hh:73
std::string JSYSTEM::JDateAndTime::operator() ( ) const
inline

Get ASCII formatted date and time.

Returns
date and time

Definition at line 86 of file JDate.hh.

87  {
88  return toString();
89  }
std::string toString() const
Get ASCII formatted date and time.
Definition: JDate.hh:73
static std::string JSYSTEM::JDateAndTime::toString ( const time_t &  ts)
inlinestatic

Get ASCII formatted date and time.

Parameters
tstime structure
Returns
date and time

Definition at line 98 of file JDate.hh.

99  {
100  std::string buffer = ctime(&ts);
101 
102  // remove the last character (carriage return) from the date string
103 
104  return buffer.substr(0, buffer.length() - 1);
105  }

Member Data Documentation

time_t JSYSTEM::JDateAndTime::ts
mutableprivate

Definition at line 108 of file JDate.hh.


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