17 #include "present/internal/cpp-guard.h"
18 #include "present/internal/header-utils.h"
21 #include "present/internal/present-day-delta-data.h"
23 #ifndef _PRESENT_DAY_DELTA_H_
24 #define _PRESENT_DAY_DELTA_H_
42 struct PresentDayDeltaData data_;
61 double weeks_decimal()
const;
67 bool is_negative()
const;
88 DayDelta & operator*=(
const long & scale_factor);
90 DayDelta & operator/=(
const long & scale_factor);
95 const long & scale_factor);
99 const long & scale_factor);
258 const struct DayDelta *
const other);
267 const struct DayDelta *
const other);
int_delta DayDelta_weeks(const struct DayDelta *const self)
Get the number of weeks represented by a DayDelta.
short DayDelta_compare_to_TimeDelta(const struct DayDelta *const lhs, const struct TimeDelta *const rhs)
Compare a DayDelta to a TimeDelta.
struct DayDelta DayDelta_from_weeks(int_delta weeks)
Create a new DayDelta based on a positive or negative number of weeks.
int_delta DayDelta_days(const struct DayDelta *const self)
Get the number of days represented by a DayDelta.
double DayDelta_weeks_decimal(const struct DayDelta *const self)
Get the number of weeks represented by a DayDelta, with a fractional part if necessary.
present_int64 int_delta
Definition: types.h:86
void DayDelta_ptr_from_days(struct DayDelta *const result, int_delta days)
Create a new DayDelta based on a positive or negative number of days.
present_bool DayDelta_equal_TimeDelta(const struct DayDelta *const lhs, const struct TimeDelta *const rhs)
Determine whether a DayDelta equals a TimeDelta (lhs == rhs).
struct DayDelta DayDelta_zero(void)
Create a new DayDelta initialized to zero days.
void DayDelta_add(struct DayDelta *const self, const struct DayDelta *const other)
Add another DayDelta to a DayDelta.
present_bool DayDelta_less_than(const struct DayDelta *const lhs, const struct DayDelta *const rhs)
Determine whether a DayDelta is less than another DayDelta (lhs < rhs).
present_bool DayDelta_less_than_or_equal(const struct DayDelta *const lhs, const struct DayDelta *const rhs)
Determine whether a DayDelta is less than or equal to another DayDelta (lhs <= rhs).
present_bool DayDelta_greater_than_TimeDelta(const struct DayDelta *const lhs, const struct TimeDelta *const rhs)
Determine whether a DayDelta is greater than a TimeDelta (lhs > rhs).
present_bool DayDelta_less_than_TimeDelta(const struct DayDelta *const lhs, const struct TimeDelta *const rhs)
Determine whether a DayDelta is less than a TimeDelta (lhs < rhs).
void DayDelta_negate(struct DayDelta *const self)
Negate a DayDelta, making it negative if it was positive or positive if it was negative.
int_delta weeks() const
Get the number of weeks represented by a DayDelta.
void DayDelta_ptr_from_weeks(struct DayDelta *const result, int_delta weeks)
Create a new DayDelta based on a positive or negative number of weeks.
present_bool DayDelta_equal(const struct DayDelta *const lhs, const struct DayDelta *const rhs)
Determine whether two DayDelta instances are equal (lhs == rhs).
present_bool DayDelta_greater_than_or_equal_TimeDelta(const struct DayDelta *const lhs, const struct TimeDelta *const rhs)
Determine whether a DayDelta is greater than or equal to a TimeDelta (lhs >= rhs).
Class or struct representing a positive or negative delta of a number of days or weeks.
Definition: day-delta.h:40
Class or struct representing a positive or negative delta of a number of nanoseconds, seconds, minutes, hours, days, or weeks.
Definition: time-delta.h:40
struct TimeDelta DayDelta_to_TimeDelta(const struct DayDelta *const self)
Convert a DayDelta into an equivalent TimeDelta.
void DayDelta_subtract(struct DayDelta *const self, const struct DayDelta *const other)
Subtract another DayDelta from a DayDelta.
present_bool DayDelta_less_than_or_equal_TimeDelta(const struct DayDelta *const lhs, const struct TimeDelta *const rhs)
Determine whether a DayDelta is less than or equal to a TimeDelta (lhs <= rhs).
struct DayDelta DayDelta_from_days(int_delta days)
Create a new DayDelta based on a positive or negative number of days.
present_bool DayDelta_greater_than_or_equal(const struct DayDelta *const lhs, const struct DayDelta *const rhs)
Determine whether a DayDelta is greater than or equal to another DayDelta (lhs >= rhs)...
void DayDelta_multiply_by(struct DayDelta *const self, long scale_factor)
Scale a DayDelta by multiplying it by a scale factor.
int_delta days() const
Get the number of days represented by a DayDelta.
void DayDelta_ptr_zero(struct DayDelta *const result)
Create a new DayDelta initialized to zero days.
present_bool DayDelta_greater_than(const struct DayDelta *const lhs, const struct DayDelta *const rhs)
Determine whether a DayDelta is greater than another DayDelta (lhs > rhs).
void DayDelta_divide_by(struct DayDelta *const self, long scale_factor)
Scale a DayDelta by dividing it by a scale factor.
short DayDelta_compare(const struct DayDelta *const lhs, const struct DayDelta *const rhs)
Compare two DayDelta instances.
present_bool DayDelta_is_negative(const struct DayDelta *const self)
Determine whether a DayDelta is negative.
bool present_bool
Definition: types.h:21