4#include "include/data_types/data_type.h"
12concept Short = std::is_same_v<qint16, T> || std::is_same_v<quint16, T>;
44 inline bool isValid()
const {
return (this->
value() > INVALID_YEAR); }
58 void adjust(
const qint32 adjustment_amount,
const bool allow_pre_1901_years =
false);
The DataType class is a template class for all C++ integral and floating point data types.
Definition: data_type.h:18
T value() const
Returns the raw value which can otherwise be accessed via QVariant data(const qint32 role).
Definition: data_type.h:33
void setData(const QVariant &value, const qint32 role=Qt::EditRole)
Sets the role data for the item at to value.
Definition: data_type.h:167
The Year class represents a calendar year value. Only qint16 and quint16 are permissible.
Definition: year.h:19
bool isInvalid() const
Returns whether the year is invalid (i.e. <= 1900).
Definition: year.h:40
void adjust(const qint32 adjustment_amount, const bool allow_pre_1901_years=false)
Adjusts the year by adjustment amount.
void reset()
Resets the year to its default invalid value of ENUM_FLAGS::INVALID_YEAR.
Definition: year.h:62
bool isWithinRange(const qint32 min, const qint32 max) const
Returns whether the year is >= min and <= max
void validate(const qint32 year)
Sets the year to year if year is valid.
bool compare(const QString &year) const
Compares the current value with year.
bool isValid() const
Returns whether the year is valid (i.e. > 1900).
Definition: year.h:44
void setIfLater(const Year &comparator)
Sets the year to comparator if comparator is greater than the present value.
namespace ehm_dal::data_types
Definition: attribute.h:6