Hyper API for C++ 0.0.18825
Hyper client library for C++ applications
Loading...
Searching...
No Matches
hyperapi::Interval Class Referencefinal

An interval data value. More...

#include <Interval.hpp>

Public Member Functions

 Interval () noexcept
 Default constructor.
 
 Interval (std::int32_t years, std::int32_t months, std::int32_t days, std::int32_t hours, std::int32_t minutes, std::int32_t seconds, std::int32_t microseconds) noexcept
 Creates an interval value from a number of years, months, days, hours, minutes, seconds, and microseconds.
 
std::int32_t getYears () const noexcept
 Gets the number of years in the interval.
 
std::int32_t getMonths () const noexcept
 Gets the number of months in the interval.
 
std::int32_t getDays () const noexcept
 Gets the number of days in the interval.
 
std::int32_t getHours () const noexcept
 Gets the number of hours in the interval.
 
std::int32_t getMinutes () const noexcept
 Gets the number of minutes in the interval.
 
std::int32_t getSeconds () const noexcept
 Gets the number of seconds in the interval.
 
std::int32_t getMicroseconds () const noexcept
 Gets the number of microseconds in the interval.
 
std::string toString () const
 Gets a string representation for debugging.
 

Detailed Description

An interval data value.

Definition at line 18 of file Interval.hpp.

Constructor & Destructor Documentation

◆ Interval() [1/2]

hyperapi::Interval::Interval ( )
inlinenoexcept

Default constructor.

Definition at line 23 of file Interval.hpp.

◆ Interval() [2/2]

hyperapi::Interval::Interval ( std::int32_t  years,
std::int32_t  months,
std::int32_t  days,
std::int32_t  hours,
std::int32_t  minutes,
std::int32_t  seconds,
std::int32_t  microseconds 
)
noexcept

Creates an interval value from a number of years, months, days, hours, minutes, seconds, and microseconds.

Parameters
yearsThe years.
monthsThe months.
daysThe days.
hoursThe hours.
minutesThe minutes.
secondsThe seconds.
microsecondsThe microseconds.

Member Function Documentation

◆ getDays()

std::int32_t hyperapi::Interval::getDays ( ) const
noexcept

Gets the number of days in the interval.

Returns
The number of days.

◆ getHours()

std::int32_t hyperapi::Interval::getHours ( ) const
noexcept

Gets the number of hours in the interval.

Returns
The number of hours.

◆ getMicroseconds()

std::int32_t hyperapi::Interval::getMicroseconds ( ) const
noexcept

Gets the number of microseconds in the interval.

Returns
The number of microseconds.

◆ getMinutes()

std::int32_t hyperapi::Interval::getMinutes ( ) const
noexcept

Gets the number of minutes in the interval.

Returns
The number of minutes.

◆ getMonths()

std::int32_t hyperapi::Interval::getMonths ( ) const
noexcept

Gets the number of months in the interval.

Returns
The number of months.

◆ getSeconds()

std::int32_t hyperapi::Interval::getSeconds ( ) const
noexcept

Gets the number of seconds in the interval.

Returns
The number of seconds.

◆ getYears()

std::int32_t hyperapi::Interval::getYears ( ) const
noexcept

Gets the number of years in the interval.

Returns
The number of years.

◆ toString()

std::string hyperapi::Interval::toString ( ) const

Gets a string representation for debugging.

Returns
the interval in the 'P<date>T<time>' format while date is in the'[n]Y[n]M[n]D' format and time is in the '[n]H[n]M[n]S' format. Elements that are 0 will be omitted.

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