23 #include "ocilibcpp/types.hpp"
40 Environment::GetEnvironmentHandle()
49 Environment::GetEnvironmentHandle()
57 AcquireTransient(pTimestamp, parent);
69 inline int Timestamp::Compare(
const Timestamp& other)
const
105 int year, month, day;
113 int year, month, day;
122 int year, month, day;
130 int year, month, day;
139 int year, month, day;
147 int hour, minutes, seconds, milliseconds;
149 GetTime(hour, minutes, seconds, milliseconds);
156 int hour, minutes, seconds, milliseconds;
158 GetTime(hour, minutes, seconds, milliseconds);
159 SetTime(value, minutes, seconds, milliseconds);
164 int hour, minutes, seconds, milliseconds;
166 GetTime(hour, minutes, seconds, milliseconds);
173 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
175 GetTime(hour, minutes, seconds, milliseconds);
176 SetTime(hour, value, seconds, milliseconds);
181 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
183 GetTime(hour, minutes, seconds, milliseconds);
190 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
192 GetTime(hour, minutes, seconds, milliseconds);
193 SetTime(hour, minutes, value, milliseconds);
198 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
200 GetTime(hour, minutes, seconds, milliseconds);
207 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
209 GetTime(hour, minutes, seconds, milliseconds);
210 SetTime(hour, minutes, seconds, value);
230 int tmpYear = 0, tmpMonth = 0, tempDay = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
232 GetDateTime(tmpYear, tmpMonth, tempDay, hour, minutes, seconds, milliseconds);
233 SetDateTime(year, month, day, hour, minutes, seconds, milliseconds);
238 int year = 0, month = 0, day = 0, tmpHour = 0, tmpMinutes = 0, tmpSeconds = 0, tmpMilliseconds = 0;
240 GetDateTime(year, month, day, tmpHour, tmpMinutes, tmpSeconds, tmpMilliseconds);
241 SetDateTime(year, month, day, hour, min, sec, fsec);
248 int year = 0, month = 0, day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
250 GetDateTime(year, month, day, hour, minutes, seconds, milliseconds);
251 SetDateTime(year, month, day, hour, minutes, seconds, milliseconds, timeZone);
259 const size_t size = OCI_SIZE_BUFFER;
299 const size_t size = OCI_SIZE_BUFFER;
308 return OCI_STRING_NULL;
349 return result += value;
357 return result -= value;
370 return result += other;
376 return result -= other;
395 return *
this += interval;
402 return *
this -= interval;
407 return Compare(other) == 0;
412 return (!(*
this == other));
417 return (Compare(other) > 0);
422 return (Compare(other) < 0);
427 const int res = Compare(other);
429 return (res == 0 || res < 0);
434 const int res = Compare(other);
436 return (res == 0 || res > 0);
static ostring GetFormat(FormatType formatType)
Return the format string for implicit string conversions of the given type.
Object identifying the SQL data type INTERVAL.
void SetDay(int value)
Set the interval day value.
Object identifying the SQL data type TIMESTAMP.
Timestamp & operator++()
Increment the timestamp by 1 day.
void SetDate(int year, int month, int day)
Set the date part.
void SetMinutes(int value)
Set the timestamp minutes value.
void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const
Extract date and time parts.
Timestamp()
Create an empty null timestamp instance.
Timestamp operator+(int value) const
Return a new Timestamp holding the current Timestamp value incremented by the given number of days.
int GetMilliSeconds() const
Return the timestamp seconds value.
bool operator>(const Timestamp &other) const
Indicates if the current Timestamp value is superior to the given Timestamp value.
void SetHours(int value)
Set the timestamp hours value.
bool operator>=(const Timestamp &other) const
Indicates if the current Timestamp value is superior or equal to the given Timestamp value.
void GetDate(int &year, int &month, int &day) const
Extract the date parts.
void Convert(const Timestamp &other)
Convert the current timestamp to the type of the given timestamp.
Timestamp operator-(int value) const
Return a new Timestamp holding the current Timestamp value decremented by the given number of days.
void FromString(const ostring &data, const ostring &format=OCI_STRING_FORMAT_DATE)
Assign to the timestamp object the value provided by the input date time string.
int GetHours() const
Return the timestamp hours value.
Timestamp & operator-=(int value)
Decrement the Timestamp by the given number of days.
void SetSeconds(int value)
Set the timestamp seconds value.
ostring ToString() const override
Convert the timestamp value to a string using default date format and no precision.
bool operator!=(const Timestamp &other) const
Indicates if the current Timestamp value is not equal the given Timestamp value.
void SetTimeZone(const ostring &timeZone)
Set the given time zone to the timestamp.
TimestampType GetType() const
Return the type of the given timestamp object.
void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring &timeZone=OTEXT(""))
Set the timestamp value from given date time parts.
Timestamp & operator+=(int value)
Increment the Timestamp by the given number of days.
void SetTime(int hour, int min, int sec, int fsec)
Set the time part.
ostring GetTimeZone() const
Return the name of the current time zone.
Timestamp Clone() const
Clone the current instance to a new one performing deep copy.
int GetMinutes() const
Return the timestamp minutes value.
bool IsValid() const
Check if the given timestamp is valid.
int GetDay() const
Return the timestamp day value.
static Timestamp SysTimestamp(TimestampType type=NoTimeZone)
return the current system timestamp
int GetYear() const
Return the timestamp year value.
int GetSeconds() const
Return the timestamp seconds value.
bool operator==(const Timestamp &other) const
Indicates if the current Timestamp value is equal to the given Timestamp value.
core::Enum< TimestampTypeValues > TimestampType
Type of timestamp.
bool operator<(const Timestamp &other) const
Indicates if the current Timestamp value is inferior to the given Timestamp value.
bool operator<=(const Timestamp &other) const
Indicates if the current Timestamp value is inferior or equal to the given Timestamp value.
void SetYear(int value)
Set the timestamp year value.
void GetTimeZoneOffset(int &hour, int &min) const
Return the time zone (hour, minute) offsets.
void SetMilliSeconds(int value)
Set the timestamp milliseconds value.
Timestamp & operator--()
Decrement the Timestamp by 1 day.
void SetDay(int value)
Set the timestamp day value.
static void Substract(const Timestamp &lsh, const Timestamp &rsh, Interval &result)
Subtract the given two timestamp and store the result into the given Interval.
void SetMonth(int value)
Set the timestamp month value.
int GetMonth() const
Return the timestamp month value.
void GetTime(int &hour, int &min, int &sec, int &fsec) const
Extract time parts.
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_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampGetTime(OCI_Timestamp *tmsp, int *hour, int *min, int *sec, int *fsec)
Extract the time portion from a timestamp handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampGetTimeZoneOffset(OCI_Timestamp *tmsp, int *hour, int *min)
Return the time zone (hour, minute) portion of a timestamp handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampGetTimeZoneName(OCI_Timestamp *tmsp, int size, otext *str)
Return the time zone name of a timestamp handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampGetDateTime(OCI_Timestamp *tmsp, int *year, int *month, int *day, int *hour, int *min, int *sec, int *fsec)
Extract the date and time parts from a date handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampConvert(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp_src)
Convert one timestamp value from one type to another.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampIntervalAdd(OCI_Timestamp *tmsp, OCI_Interval *itv)
Add an interval value to a timestamp value of a timestamp handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampFromText(OCI_Timestamp *tmsp, const otext *str, const otext *fmt)
Convert a string to a timestamp and store it in the given timestamp handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampIntervalSub(OCI_Timestamp *tmsp, OCI_Interval *itv)
Subtract an interval value from a timestamp value of a timestamp handle.
OCI_SYM_PUBLIC OCI_Timestamp *OCI_API OCI_TimestampCreate(OCI_Connection *con, unsigned int type)
Create a local Timestamp instance.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_TimestampGetType(OCI_Timestamp *tmsp)
Return the type of the given Timestamp object.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampConstruct(OCI_Timestamp *tmsp, int year, int month, int day, int hour, int min, int sec, int fsec, const otext *time_zone)
Set a timestamp handle value.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampSysTimestamp(OCI_Timestamp *tmsp)
Stores the system current date and time as a timestamp value with time zone into the timestamp handle...
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampToText(OCI_Timestamp *tmsp, const otext *fmt, int size, otext *str, int precision)
Convert a timestamp value from the given timestamp handle to a string.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampSubtract(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp2, OCI_Interval *itv)
Store the difference of two timestamp handles into an interval handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampAssign(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp_src)
Assign the value of a timestamp handle to another one.
OCI_SYM_PUBLIC int OCI_API OCI_TimestampCompare(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp2)
Compares two timestamp handles.
OCI_SYM_PUBLIC int OCI_API OCI_TimestampCheck(OCI_Timestamp *tmsp)
Check if the given timestamp is valid.
OCI_SYM_PUBLIC boolean OCI_API OCI_TimestampGetDate(OCI_Timestamp *tmsp, int *year, int *month, int *day)
Extract the date part from a timestamp 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 )