23 #include "ocilibcpp/types.hpp"
40 Environment::GetEnvironmentHandle()
49 Environment::GetEnvironmentHandle()
57 AcquireTransient(pInterval, parent);
69 inline int Interval::Compare(
const Interval& other)
const
86 int year = 0, month = 0;
95 int year = 0, month = 0;
103 int year = 0, month = 0;
112 int year = 0, month = 0;
120 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
122 GetDaySecond(day, hour, minutes, seconds, milliseconds);
129 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
131 GetDaySecond(day, hour, minutes, seconds, milliseconds);
132 SetDaySecond(value, hour, minutes, seconds, milliseconds);
137 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
139 GetDaySecond(day, hour, minutes, seconds, milliseconds);
146 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
148 GetDaySecond(day, hour, minutes, seconds, milliseconds);
149 SetDaySecond(day, value, minutes, seconds, milliseconds);
154 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
156 GetDaySecond(day, hour, minutes, seconds, milliseconds);
163 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
165 GetDaySecond(day, hour, minutes, seconds, milliseconds);
171 int day, hour, minutes, seconds, milliseconds;
173 GetDaySecond(day, hour, minutes, seconds, milliseconds);
180 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
182 GetDaySecond(day, hour, minutes, seconds, milliseconds);
188 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
190 GetDaySecond(day, hour, minutes, seconds, milliseconds);
197 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
199 GetDaySecond(day, hour, minutes, seconds, milliseconds);
236 const size_t size = OCI_SIZE_BUFFER;
245 return OCI_STRING_NULL;
250 return ToString(OCI_STRING_DEFAULT_PREC, OCI_STRING_DEFAULT_PREC);
256 return result += other;
262 return result -= other;
279 return Compare(other) == 0;
284 return (!(*
this == other));
289 return (Compare(other) > 0);
294 return (Compare(other) < 0);
299 const int res = Compare(other);
301 return (res == 0 || res < 0);
306 const int res = Compare(other);
308 return (res == 0 || res > 0);
Object identifying the SQL data type INTERVAL.
int GetYear() const
Return the interval year value.
Interval & operator+=(const Interval &other)
Increment the current Value with the given Interval value.
int GetDay() const
Return the interval day value.
void SetDay(int value)
Set the interval day value.
void SetSeconds(int value)
Set the interval seconds value.
void SetYear(int value)
Set the interval year value.
Interval operator-(const Interval &other) const
Return a new Interval holding the difference of the current Interval value and the given Interval val...
int GetMinutes() const
Return the interval minutes value.
void GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const
Extract the date / second parts from the interval value.
int GetSeconds() const
Return the interval seconds value.
int GetHours() const
Return the interval hours value.
Interval operator+(const Interval &other) const
Return a new Interval holding the sum of the current Interval value and the given Interval value.
void SetMonth(int value)
Set the interval month value.
void SetMinutes(int value)
Set the interval minutes value.
bool operator<=(const Interval &other) const
Indicates if the current Interval value is inferior or equal to the given Interval value.
void SetMilliSeconds(int value)
Set the interval milliseconds value.
int GetMilliSeconds() const
Return the interval seconds value.
void UpdateTimeZone(const ostring &timeZone)
Update the interval value with the given time zone.
Interval & operator-=(const Interval &other)
Decrement the current Value with the given Interval value.
void GetYearMonth(int &year, int &month) const
Extract the year / month parts from the interval value.
ostring ToString() const override
Convert the interval value to a string using the default precisions of 10.
void SetHours(int value)
Set the interval hours value.
void SetDaySecond(int day, int hour, int min, int sec, int fsec)
Set the Day / Second parts.
void SetYearMonth(int year, int month)
Set the Year / Month parts.
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.
Interval()
Create an empty null Interval instance.
bool operator!=(const Interval &other) const
Indicates if the current Interval value is not equal the given Interval value.
Interval Clone() const
Clone the current instance to a new one performing deep copy.
int GetMonth() const
Return the interval month value.
bool operator>=(const Interval &other) const
Indicates if the current Interval value is superior or equal to the given Interval value.
void FromString(const ostring &data)
Assign to the interval object the value provided by the input interval string.
bool IsValid() const
Check if the given interval is valid.
IntervalType GetType() const
Return the type of the given interval object.
core::Enum< IntervalTypeValues > IntervalType
Interval types.
bool operator==(const Interval &other) const
Indicates if the current Interval value is equal to the given Interval value.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Internal usage. Interface for handling ownership and relationship of a C API handle.
Internal usage. Provide a buffer class with RAII capabilities.
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalAdd(OCI_Interval *itv, OCI_Interval *itv2)
Adds an interval handle value to another.
OCI_SYM_PUBLIC int OCI_API OCI_IntervalCheck(OCI_Interval *itv)
Check if the given interval is valid.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalGetYearMonth(OCI_Interval *itv, int *year, int *month)
Return the year / month portion of an interval handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalSubtract(OCI_Interval *itv, OCI_Interval *itv2)
Subtract an interval handle value from another.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalAssign(OCI_Interval *itv, OCI_Interval *itv_src)
Assign the value of a interval handle to another one.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalSetYearMonth(OCI_Interval *itv, int year, int month)
Set the year / month portion if the given Interval handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalGetDaySecond(OCI_Interval *itv, int *day, int *hour, int *min, int *sec, int *fsec)
Return the day / time portion of an interval handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalFromTimeZone(OCI_Interval *itv, const otext *str)
Correct an interval handle value with the given time zone.
OCI_SYM_PUBLIC int OCI_API OCI_IntervalCompare(OCI_Interval *itv, OCI_Interval *itv2)
Compares two interval handles.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_IntervalGetType(OCI_Interval *itv)
Return the type of the given Interval object.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalFromText(OCI_Interval *itv, const otext *str)
Convert a string to an interval and store it in the given interval handle.
OCI_SYM_PUBLIC OCI_Interval *OCI_API OCI_IntervalCreate(OCI_Connection *con, unsigned int type)
Create a local interval object.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalToText(OCI_Interval *itv, int leading_prec, int fraction_prec, int size, otext *str)
Convert an interval value from the given interval handle to a string.
OCI_SYM_PUBLIC boolean OCI_API OCI_IntervalSetDaySecond(OCI_Interval *itv, int day, int hour, int min, int sec, int fsec)
Set the day / time portion if the given interval handle.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets )