KDbDate
#include <KDbDateTime.h>
Public Member Functions | |
KDbDate ()=default | |
KDbDate (const KDbYear &year, const QByteArray &monthString, const QByteArray &dayString) | |
int | day () const |
QByteArray | dayString () const |
bool | isNull () const |
bool | isValid () const |
int | month () const |
QByteArray | monthString () const |
bool | operator!= (const KDbDate &other) const |
bool | operator< (const KDbDate &other) const |
bool | operator<= (const KDbDate &other) const |
bool | operator== (const KDbDate &other) const |
bool | operator> (const KDbDate &other) const |
bool | operator>= (const KDbDate &other) const |
QDate | toQDate () const |
QByteArray | toString () const |
KDbYear | year () const |
Detailed Description
Constructor & Destructor Documentation
◆ KDbDate() [1/2]
|
inline |
Definition at line 160 of file KDbDateTime.h.
◆ KDbDate() [2/2]
|
default |
Constructs a null date.
Member Function Documentation
◆ day()
int KDbDate::day | ( | ) | const |
Returns the day part of the date converted to integer.
Correct values are in range 1..31, -1 is returned for invalid day. THe date can be still invalid for valid integer, e.g. February 31st.
Definition at line 255 of file KDbDateTime.cpp.
◆ dayString()
|
inline |
Returns the day part of the date.
It is original string passed to the KDbDate object and may be invalid.
Definition at line 242 of file KDbDateTime.h.
◆ isNull()
bool KDbDate::isNull | ( | ) | const |
Returns true
if the date is null.
A date is null if its year is null, month string is empty and date string is empty.
Definition at line 223 of file KDbDateTime.cpp.
◆ isValid()
bool KDbDate::isValid | ( | ) | const |
Returns true
if the date is valid.
Validation is performed by converting to QDate (toQDate()) and checking if it is valid.
Definition at line 218 of file KDbDateTime.cpp.
◆ month()
int KDbDate::month | ( | ) | const |
Returns the month part of the date converted to integer.
Correct values are in range 1..12, -1 is returned for invalid month.
Definition at line 250 of file KDbDateTime.cpp.
◆ monthString()
|
inline |
Returns the month part of the date.
It is original string passed to the KDbDate object and may be invalid.
Definition at line 227 of file KDbDateTime.h.
◆ operator!=()
|
inline |
Definition at line 172 of file KDbDateTime.h.
◆ operator<()
bool KDbDate::operator< | ( | const KDbDate & | other | ) | const |
Definition at line 213 of file KDbDateTime.cpp.
◆ operator<=()
|
inline |
Definition at line 176 of file KDbDateTime.h.
◆ operator==()
bool KDbDate::operator== | ( | const KDbDate & | other | ) | const |
Definition at line 207 of file KDbDateTime.cpp.
◆ operator>()
|
inline |
Definition at line 180 of file KDbDateTime.h.
◆ operator>=()
|
inline |
Definition at line 178 of file KDbDateTime.h.
◆ toQDate()
QDate KDbDate::toQDate | ( | ) | const |
Returns the date converted to QDate value.
Invalid QDate is returned if the KDbDate is invalid.
Definition at line 228 of file KDbDateTime.cpp.
◆ toString()
QByteArray KDbDate::toString | ( | ) | const |
Returns the date value converted to string even if it is invalid.
For null dates empty string is returned.
Definition at line 260 of file KDbDateTime.cpp.
◆ year()
|
inline |
Returns the year part of the date.
Definition at line 213 of file KDbDateTime.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.