|
OCILIB (C and C++ Driver for Oracle)
4.0.0
|
Object identifying the SQL data type INTERVAL. More...
#include <ocilib.hpp>
Inherits ocilib::HandleHolder< OCI_Interval * >.
Public Types | |
| enum | IntervalTypeValues { YearMonth = OCI_INTERVAL_YM, DaySecond = OCI_INTERVAL_DS } |
| Interval types enumerated values. More... | |
| typedef Enum< IntervalTypeValues > | IntervalType |
| Interval types. More... | |
Public Member Functions | |
| Interval (IntervalType type) | |
| Create a new instance of the given type. More... | |
| IntervalType | GetType () const |
| Return the type of the given interval object. | |
| bool | IsValid () const |
| Check if the given interval is valid. | |
| int | GetYear () const |
| Return the interval year value. More... | |
| void | SetYear (int value) |
| Set the interval year value. More... | |
| int | GetMonth () const |
| Return the interval month value. More... | |
| void | SetMonth (int value) |
| Set the interval month value. More... | |
| int | GetDay () const |
| Return the interval day value. More... | |
| void | SetDay (int value) |
| Set the interval day value. More... | |
| int | GetHours () const |
| Return the interval hours value. More... | |
| void | SetHours (int value) |
| Set the interval hours value. More... | |
| int | GetMinutes () const |
| Return the interval minutes value. More... | |
| void | SetMinutes (int value) |
| Set the interval minutes value. More... | |
| int | GetSeconds () const |
| Return the interval seconds value. More... | |
| void | SetSeconds (int value) |
| Set the interval seconds value. More... | |
| int | GetMilliSeconds () const |
| Return the interval seconds value. | |
| void | SetMilliSeconds (int value) |
| Set the interval milliseconds value. | |
| void | GetDaySecond (int &day, int &hour, int &min, int &sec, int &fsec) const |
| Extract the date / second parts from the interval value. More... | |
| void | SetDaySecond (int day, int hour, int min, int sec, int fsec) |
| Set the Day / Second parts. More... | |
| void | GetYearMonth (int &year, int &month) const |
| Extract the year / month parts from the interval value. More... | |
| void | SetYearMonth (int year, int month) |
| Set the Year / Month parts. More... | |
| void | UpdateTimeZone (const ostring &timeZone) |
| Update the interval value with the given time zone. More... | |
| void | FromString (const ostring &data) |
| Assign to the interval object the value provided by the input interval string. More... | |
| ostring | ToString (int leadingPrecision=10, int fractionPrecision=10) const |
| Convert the interval value to a string. More... | |
| Interval | Clone () const |
| Clone the current instance to a new one performing deep copy. | |
| operator ostring () const | |
| Convenient operator converting the interval value to a string. More... | |
| Interval | operator+ (const Interval &other) |
| Return a new Interval holding the sum of the current Interval value and the given Interval value. | |
| Interval | operator- (const Interval &other) |
| Return a new Interval holding the difference of the current Interval value and the given Interval value. | |
| Interval & | operator+= (const Interval &other) |
| Increment the current Value with the given Interval value. | |
| Interval & | operator-= (const Interval &other) |
| Decrement the current Value with the given Interval value. | |
| bool | operator== (const Interval &other) const |
| Indicates if the current Interval value is equal to the given Interval value. | |
| bool | operator!= (const Interval &other) const |
| Indicates if the current Interval value is not equal the given Interval value. | |
| bool | operator> (const Interval &other) const |
| Indicates if the current Interval value is superior to the given Interval value. | |
| bool | operator< (const Interval &other) const |
| Indicates if the current Interval value is inferior to the given Interval value. | |
| bool | operator>= (const Interval &other) const |
| Indicates if the current Interval value is superior or equal to the given Interval value. | |
| bool | operator<= (const Interval &other) const |
| Indicates if the current Interval value is inferior or equal to the given Interval value. | |
Object identifying the SQL data type INTERVAL.
This class wraps the OCILIB object handle OCI_Interval and its related methods
Definition at line 2707 of file ocilib.hpp.
Interval types.
Possible values are Interval::IntervalTypeValues
Definition at line 2739 of file ocilib.hpp.
Interval types enumerated values.
| Enumerator | |
|---|---|
| YearMonth |
Interval unit range is months -> years |
| DaySecond |
Interval unit range is seconds -> days |
Definition at line 2724 of file ocilib.hpp.
|
inline |
Create a new instance of the given type.
| type | - Interval type to create |
Definition at line 1664 of file ocilib_impl.hpp.
References ocilib::Check(), OCI_IntervalCreate(), and OCI_IntervalFree().
|
inline |
Return the interval year value.
Definition at line 1698 of file ocilib_impl.hpp.
References GetYearMonth().
|
inline |
Set the interval year value.
Definition at line 1707 of file ocilib_impl.hpp.
References GetYearMonth(), and SetYearMonth().
|
inline |
Return the interval month value.
Definition at line 1715 of file ocilib_impl.hpp.
References GetYearMonth().
|
inline |
Set the interval month value.
Definition at line 1724 of file ocilib_impl.hpp.
References GetYearMonth(), and SetYearMonth().
|
inline |
Return the interval day value.
Definition at line 1732 of file ocilib_impl.hpp.
References GetDaySecond().
|
inline |
Set the interval day value.
Definition at line 1741 of file ocilib_impl.hpp.
References GetDaySecond(), and SetDaySecond().
Referenced by ocilib::Timestamp::operator+(), ocilib::Timestamp::operator+=(), ocilib::Timestamp::operator-(), and ocilib::Timestamp::operator-=().
|
inline |
Return the interval hours value.
Definition at line 1749 of file ocilib_impl.hpp.
References GetDaySecond().
|
inline |
Set the interval hours value.
Definition at line 1758 of file ocilib_impl.hpp.
References GetDaySecond(), and SetDaySecond().
|
inline |
Return the interval minutes value.
Definition at line 1766 of file ocilib_impl.hpp.
References GetDaySecond().
|
inline |
Set the interval minutes value.
Definition at line 1775 of file ocilib_impl.hpp.
References GetDaySecond(), and SetDaySecond().
|
inline |
Return the interval seconds value.
Definition at line 1783 of file ocilib_impl.hpp.
References GetDaySecond().
|
inline |
Set the interval seconds value.
Definition at line 1792 of file ocilib_impl.hpp.
References GetDaySecond(), and SetDaySecond().
|
inline |
Extract the date / second parts from the interval value.
| day | - Place holder for Day value |
| hour | - Place holder for Hour value |
| min | - Place holder for Minutes value |
| sec | - Place holder for Seconds value |
| fsec | - Place holder for Milliseconds value |
Definition at line 1817 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalGetDaySecond().
Referenced by GetDay(), GetHours(), GetMilliSeconds(), GetMinutes(), GetSeconds(), SetDay(), SetHours(), SetMilliSeconds(), SetMinutes(), and SetSeconds().
|
inline |
Set the Day / Second parts.
| day | - Day value |
| hour | - Hour value |
| min | - Minutes value |
| sec | - Seconds value |
| fsec | - Milliseconds value |
Definition at line 1822 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalSetDaySecond().
Referenced by SetDay(), SetHours(), SetMilliSeconds(), SetMinutes(), and SetSeconds().
|
inline |
Extract the year / month parts from the interval value.
| year | - Place holder for year value |
| month | - Place holder for month value |
Definition at line 1827 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalGetYearMonth().
Referenced by GetMonth(), GetYear(), SetMonth(), and SetYear().
|
inline |
Set the Year / Month parts.
| year | - Year value |
| month | - Month value |
Definition at line 1831 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalSetYearMonth().
Referenced by SetMonth(), and SetYear().
|
inline |
Update the interval value with the given time zone.
| timeZone | - Time zone name |
Definition at line 1836 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalFromTimeZone().
|
inline |
Assign to the interval object the value provided by the input interval string.
| data | - String interval |
Definition at line 1841 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalFromText().
|
inline |
Convert the interval value to a string.
| leadingPrecision | - leading precision |
| fractionPrecision | - fraction precision |
Definition at line 1846 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_IntervalToText().
|
inline |
Convenient operator converting the interval value to a string.
Definition at line 1857 of file ocilib_impl.hpp.