ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | Friends | List of all members
ocpp::DateTimeImpl Class Reference

Contains a DateTime implementation that can parse and create RFC 3339 compatible strings. More...

#include <types.hpp>

Inheritance diagram for ocpp::DateTimeImpl:
ocpp::DateTime

Public Member Functions

 DateTimeImpl ()
 Creates a new DateTimeImpl object with the current utc time.
 
 DateTimeImpl (std::chrono::time_point< date::utc_clock > timepoint)
 Creates a new DateTimeImpl object from the given timepoint.
 
 DateTimeImpl (const std::string &timepoint_str)
 Creates a new DateTimeImpl object from the given timepoint_str.
 
std::string to_rfc3339 () const
 Converts this DateTimeImpl to a RFC 3339 compatible string. More...
 
void from_rfc3339 (const std::string &timepoint_str)
 Sets the timepoint of this DateTimeImpl to the given timepoint_str.
 
std::chrono::time_point< date::utc_clock > to_time_point () const
 Converts this DateTimeImpl to a std::chrono::time_point. More...
 
DateTimeImploperator= (const DateTimeImpl &dt)
 Assignment operator= to assign another DateTimeImpl dt to this DateTimeImpl.
 
 operator std::string ()
 Conversion operatpr std::string returns a RFC 3339 compatible string representation of the stored DateTime.
 

Friends

std::ostream & operator<< (std::ostream &os, const DateTimeImpl &dt)
 Writes the given DateTimeImpl dt to the given output stream os as a RFC 3339 compatible string. More...
 
bool operator> (const DateTimeImpl &lhs, const DateTimeImpl &rhs)
 Comparison operator> between two DateTimeImpl lhs and rhs.
 
bool operator>= (const DateTimeImpl &lhs, const DateTimeImpl &rhs)
 Comparison operator>= between two DateTimeImpl lhs and rhs.
 
bool operator< (const DateTimeImpl &lhs, const DateTimeImpl &rhs)
 Comparison operator< between two DateTimeImpl lhs and rhs.
 
bool operator<= (const DateTimeImpl &lhs, const DateTimeImpl &rhs)
 Comparison operator<= between two DateTimeImpl lhs and rhs.
 
bool operator== (const DateTimeImpl &lhs, const DateTimeImpl &rhs)
 Comparison operator== between two DateTimeImpl lhs and rhs.
 

Detailed Description

Contains a DateTime implementation that can parse and create RFC 3339 compatible strings.

Member Function Documentation

◆ to_rfc3339()

std::string ocpp::DateTimeImpl::to_rfc3339 ( ) const

Converts this DateTimeImpl to a RFC 3339 compatible string.

Returns
a RFC 3339 compatible string representation of the stored DateTime

◆ to_time_point()

std::chrono::time_point< date::utc_clock > ocpp::DateTimeImpl::to_time_point ( ) const

Converts this DateTimeImpl to a std::chrono::time_point.

Returns
a std::chrono::time_point

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const DateTimeImpl dt 
)
friend

Writes the given DateTimeImpl dt to the given output stream os as a RFC 3339 compatible string.

Returns
an output stream with the DateTimeImpl as a RFC 3339 compatible string written to

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