cpp-utilities/chrono/period.h

50 lines
824 B
C
Raw Normal View History

2015-04-22 18:36:40 +02:00
#ifndef PERIOD_H
#define PERIOD_H
2015-09-06 20:19:09 +02:00
#include "./datetime.h"
2015-04-22 18:36:40 +02:00
2015-09-06 20:19:09 +02:00
#include "../application/global.h"
2015-04-22 18:36:40 +02:00
namespace ChronoUtilities {
class LIB_EXPORT Period
{
public:
Period(const DateTime &beg, const DateTime &end);
int years() const;
int months() const;
int days() const;
private:
int m_years;
int m_months;
int m_days;
};
/*!
2016-01-18 23:41:30 +01:00
* \brief Gets the years component of the period represented by the current instance.
2015-04-22 18:36:40 +02:00
*/
inline int Period::years() const
{
return m_years;
}
/*!
2016-01-18 23:41:30 +01:00
* \brief Gets the months component of the period represented by the current instance.
2015-04-22 18:36:40 +02:00
*/
inline int Period::months() const
{
return m_months;
}
/*!
2016-01-18 23:41:30 +01:00
* \brief Gets the days component of the period represented by the current instance.
2015-04-22 18:36:40 +02:00
*/
inline int Period::days() const
{
return m_days;
}
}
#endif // PERIOD_H