OCILIB (C and C++ Driver for Oracle)
4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
|
Object identifying the SQL data type INTERVAL. More...
#include <types.hpp>
Inherits ocilib::core::HandleHolder< OCI_Interval * >, and ocilib::core::Streamable.
Public Types | |
enum | IntervalTypeValues { YearMonth = OCI_INTERVAL_YM , DaySecond = OCI_INTERVAL_DS } |
Interval types enumerated values. More... | |
typedef core::Enum< IntervalTypeValues > | IntervalType |
Interval types. | |
Public Member Functions | |
Interval () | |
Create an empty null Interval instance. | |
Interval (IntervalType type) | |
Create a new instance of the given type. | |
Interval (IntervalType type, const ostring &data) | |
Create an interval object with the value provided by the input interval string. | |
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. | |
void | SetYear (int value) |
Set the interval year value. | |
int | GetMonth () const |
Return the interval month value. | |
void | SetMonth (int value) |
Set the interval month value. | |
int | GetDay () const |
Return the interval day value. | |
void | SetDay (int value) |
Set the interval day value. | |
int | GetHours () const |
Return the interval hours value. | |
void | SetHours (int value) |
Set the interval hours value. | |
int | GetMinutes () const |
Return the interval minutes value. | |
void | SetMinutes (int value) |
Set the interval minutes value. | |
int | GetSeconds () const |
Return the interval seconds value. | |
void | SetSeconds (int value) |
Set the interval seconds value. | |
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. | |
void | SetDaySecond (int day, int hour, int min, int sec, int fsec) |
Set the Day / Second parts. | |
void | GetYearMonth (int &year, int &month) const |
Extract the year / month parts from the interval value. | |
void | SetYearMonth (int year, int month) |
Set the Year / Month parts. | |
void | UpdateTimeZone (const ostring &timeZone) |
Update the interval value with the given time zone. | |
void | FromString (const ostring &data) |
Assign to the interval object the value provided by the input interval string. | |
ostring | ToString (int leadingPrecision, int fractionPrecision) const |
Convert the interval value to a string using the given precisions. | |
ostring | ToString () const override |
Convert the interval value to a string using the default precisions of 10. | |
Interval | Clone () const |
Clone the current instance to a new one performing deep copy. | |
Interval | operator+ (const Interval &other) const |
Return a new Interval holding the sum of the current Interval value and the given Interval value. | |
Interval | operator- (const Interval &other) const |
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
Interval types.
Possible values are Interval::IntervalTypeValues
|
inline |
Create an empty null Interval instance.
Definition at line 31 of file Interval.hpp.
|
inline |
Create a new instance of the given type.
type | - Interval type to create |
Definition at line 35 of file Interval.hpp.
References ocilib::core::Check(), and OCI_IntervalCreate().
|
inline |
Create an interval object with the value provided by the input interval string.
type | - Interval type to create |
data | - String interval |
Definition at line 44 of file Interval.hpp.
References ocilib::core::Check(), FromString(), and OCI_IntervalCreate().
|
inline |
Return the type of the given interval object.
Definition at line 74 of file Interval.hpp.
References ocilib::core::Check(), and OCI_IntervalGetType().
Referenced by Clone().
|
inline |
Check if the given interval is valid.
Definition at line 79 of file Interval.hpp.
References ocilib::core::Check(), and OCI_IntervalCheck().
|
inline |
Return the interval year value.
Definition at line 84 of file Interval.hpp.
References GetYearMonth().
|
inline |
Set the interval year value.
Definition at line 93 of file Interval.hpp.
References GetYearMonth(), and SetYearMonth().
|
inline |
Return the interval month value.
Definition at line 101 of file Interval.hpp.
References GetYearMonth().
|
inline |
Set the interval month value.
Definition at line 110 of file Interval.hpp.
References GetYearMonth(), and SetYearMonth().
|
inline |
Return the interval day value.
Definition at line 118 of file Interval.hpp.
References GetDaySecond().
|
inline |
Set the interval day value.
Definition at line 127 of file Interval.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 135 of file Interval.hpp.
References GetDaySecond().
|
inline |
Set the interval hours value.
Definition at line 144 of file Interval.hpp.
References GetDaySecond(), and SetDaySecond().
|
inline |
Return the interval minutes value.
Definition at line 152 of file Interval.hpp.
References GetDaySecond().
|
inline |
Set the interval minutes value.
Definition at line 161 of file Interval.hpp.
References GetDaySecond(), and SetDaySecond().
|
inline |
Return the interval seconds value.
Definition at line 169 of file Interval.hpp.
References GetDaySecond().
|
inline |
Set the interval seconds value.
Definition at line 178 of file Interval.hpp.
References GetDaySecond(), and SetDaySecond().
|
inline |
Return the interval seconds value.
Definition at line 186 of file Interval.hpp.
References GetDaySecond().
|
inline |
Set the interval milliseconds value.
Definition at line 195 of file Interval.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 203 of file Interval.hpp.
References ocilib::core::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 208 of file Interval.hpp.
References ocilib::core::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 213 of file Interval.hpp.
References ocilib::core::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 217 of file Interval.hpp.
References ocilib::core::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 222 of file Interval.hpp.
References ocilib::core::Check(), and OCI_IntervalFromTimeZone().
|
inline |
Assign to the interval object the value provided by the input interval string.
data | - String interval |
Definition at line 227 of file Interval.hpp.
References ocilib::core::Check(), and OCI_IntervalFromText().
Referenced by Interval().
|
inline |
Convert the interval value to a string using the given precisions.
leadingPrecision | - leading precision |
fractionPrecision | - fraction precision |
Definition at line 232 of file Interval.hpp.
References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_IntervalToText().
|
inlineoverridevirtual |
Convert the interval value to a string using the default precisions of 10.
Implements ocilib::core::Streamable.
Definition at line 248 of file Interval.hpp.
References ToString().
Referenced by ToString().
|
inline |
Clone the current instance to a new one performing deep copy.
Definition at line 60 of file Interval.hpp.
References ocilib::core::Check(), GetType(), and OCI_IntervalAssign().
Referenced by operator+(), and operator-().
Increment the current Value with the given Interval value.
Definition at line 265 of file Interval.hpp.
References ocilib::core::Check(), and OCI_IntervalAdd().
Decrement the current Value with the given Interval value.
Definition at line 271 of file Interval.hpp.
References ocilib::core::Check(), and OCI_IntervalSubtract().
|
inline |
Indicates if the current Interval value is equal to the given Interval value.
Definition at line 277 of file Interval.hpp.
|
inline |
Indicates if the current Interval value is not equal the given Interval value.
Definition at line 282 of file Interval.hpp.
|
inline |
Indicates if the current Interval value is superior to the given Interval value.
Definition at line 287 of file Interval.hpp.
|
inline |
Indicates if the current Interval value is inferior to the given Interval value.
Definition at line 292 of file Interval.hpp.
|
inline |
Indicates if the current Interval value is superior or equal to the given Interval value.
Definition at line 297 of file Interval.hpp.
|
inline |
Indicates if the current Interval value is inferior or equal to the given Interval value.
Definition at line 304 of file Interval.hpp.