wrapper for OCI DATE type More...
#include <ocipl.h>


Public Member Functions | |
| OciDate () | |
| OciDate (const OCIDate &date, OCIInd ind=OCI_IND_NOTNULL) | |
| OciDate (const ocidatetime &date, OCIInd ind=OCI_IND_NOTNULL) | |
| OciDate (OCIError *errh, const TCHAR *str, const TCHAR *fmt=TEXT("dd.mm.yyyy")) | |
| OciDate (struct tm *t) | |
| tstring | str () const |
| tstring | short_str () const |
| int | get_int_date () const |
| struct tm * | get_gmt () const |
| struct tm * | get_lctime () const |
| time_t | get_time_t () const |
| int | compare (const OciDate &other) const |
| bool | is_null () const |
| bool | is_not_null () const |
| const SqlInd & | ind () const |
| SqlInd & | ind () |
Protected Attributes | |
| SqlInd | _ind |
wrapper for OCI DATE type
Definition at line 1558 of file ocipl.h.
| OCIPL::OciDate::OciDate | ( | const OCIDate & | date, |
| OCIInd | ind = OCI_IND_NOTNULL |
||
| ) |
| OCIPL::OciDate::OciDate | ( | const ocidatetime & | date, |
| OCIInd | ind = OCI_IND_NOTNULL |
||
| ) |
Definition at line 785 of file ocipl.cpp.
References OCIPL::ocidatetime::century, OCIPL::ocidatetime::day, OCIPL::ocidatetime::hour, OCIPL::ocidatetime::minute, OCIPL::ocidatetime::month, OCIPL::ocidatetime::second, and OCIPL::ocidatetime::year.
| OCIPL::OciDate::OciDate | ( | OCIError * | errh, |
| const TCHAR * | str, | ||
| const TCHAR * | fmt = TEXT("dd.mm.yyyy") |
||
| ) |
Definition at line 796 of file ocipl.cpp.
References OCIPL::SqlValue::_ind, _tcslen, OCIPL::SqlInd::clear(), OCIPL::istspace(), OCIPL::oci_check_error(), OCIPL::SqlInd::set(), and str().
{
if (str) {
while(istspace(*str))
++str;
if (*str) {
sword res = OCIDateFromText(errh, (const OraText*)str, (ub4)_tcslen(str)*sizeof(TOraText),
(const OraText*)fmt, (ub4)_tcslen(fmt)*sizeof(TOraText), NULL/*lang*/, 0, this);
oci_check_error(errh, res);
_ind.set();
} else
_ind.clear();
} else
_ind.clear();
}

| OCIPL::OciDate::OciDate | ( | struct tm * | t ) |
Definition at line 815 of file ocipl.cpp.
References OCIPL::SqlValue::ind(), and OCIPL::SqlInd::set().
{
OCIDateYYYY = t->tm_year + 1900;
OCIDateMM = t->tm_mon + 1;
OCIDateDD = t->tm_mday;
OCIDateTime.OCITimeHH = t->tm_hour;
OCIDateTime.OCITimeMI = t->tm_min;
OCIDateTime.OCITimeSS = t->tm_sec;
ind().set();
}

| int OCIPL::OciDate::compare | ( | const OciDate & | other ) | const |
Definition at line 827 of file ocipl.cpp.
{
if (OCIDateYYYY < other.OCIDateYYYY)
return -1;
else if (OCIDateYYYY > other.OCIDateYYYY)
return 1;
if (OCIDateMM < other.OCIDateMM)
return -1;
else if (OCIDateMM > other.OCIDateMM)
return 1;
if (OCIDateDD < other.OCIDateDD)
return -1;
else if (OCIDateDD > other.OCIDateDD)
return 1;
if (OCIDateTime.OCITimeHH < other.OCIDateTime.OCITimeHH)
return -1;
else if (OCIDateTime.OCITimeHH > other.OCIDateTime.OCITimeHH)
return 1;
if (OCIDateTime.OCITimeMI < other.OCIDateTime.OCITimeMI)
return -1;
else if (OCIDateTime.OCITimeMI > other.OCIDateTime.OCITimeMI)
return 1;
if (OCIDateTime.OCITimeSS < other.OCIDateTime.OCITimeSS)
return -1;
else if (OCIDateTime.OCITimeSS > other.OCIDateTime.OCITimeSS)
return 1;
return 0;
}
| struct tm* OCIPL::OciDate::get_gmt | ( | ) | const [inline, read] |
Definition at line 1590 of file ocipl.h.
References OCIPL::ocidate_to_gmt().
{
if (_ind.is_not_null())
return ocidate_to_gmt(*this);
else
return 0;
}

| int OCIPL::OciDate::get_int_date | ( | ) | const [inline] |
| struct tm* OCIPL::OciDate::get_lctime | ( | ) | const [inline, read] |
Definition at line 1598 of file ocipl.h.
References OCIPL::ocidate_to_lctime().
{
if (_ind.is_not_null())
return ocidate_to_lctime(*this);
else
return 0;
}

| time_t OCIPL::OciDate::get_time_t | ( | ) | const [inline] |
Definition at line 1606 of file ocipl.h.
References OCIPL::ocidate_to_time_t().
{
if (_ind.is_not_null())
return ocidate_to_time_t(*this);
else
return 0;
}

| const SqlInd& OCIPL::SqlValue::ind | ( | ) | const [inline, inherited] |
Definition at line 1244 of file ocipl.h.
Referenced by OCIPL::BindInput::BindInput(), OCIPL::BindOutput::BindOutput(), OCIPL::DefinePar::DefinePar(), OciDate(), OCIPL::OciDateArray::set_date(), OCIPL::SqlDateTimeArray::set_datetime(), and OCIPL::SqlNumberArray::set_number().
{return _ind;}

| SqlInd& OCIPL::SqlValue::ind | ( | ) | [inline, inherited] |
| bool OCIPL::SqlValue::is_not_null | ( | ) | const [inline, inherited] |
Definition at line 1242 of file ocipl.h.
Referenced by OCIPL::SqlInt::operator int().
{return _ind.is_not_null();}

| bool OCIPL::SqlValue::is_null | ( | ) | const [inline, inherited] |
| tstring OCIPL::OciDate::short_str | ( | ) | const [inline] |
Definition at line 1574 of file ocipl.h.
References OCIPL::ocidate_to_short_string().
{
if (_ind.is_not_null())
return ocidate_to_short_string(*this);
else
return tstring();
}

| tstring OCIPL::OciDate::str | ( | ) | const [inline] |
Definition at line 1566 of file ocipl.h.
References OCIPL::ocidate_to_string().
Referenced by OciDate().
{
if (_ind.is_not_null())
return ocidate_to_string(*this);
else
return tstring();
}


SqlInd OCIPL::SqlValue::_ind [protected, inherited] |
Definition at line 1248 of file ocipl.h.
Referenced by OciDate(), OCIPL::SqlString::operator=(), and OCIPL::SqlNumber::SqlNumber().
1.7.2