22 #ifndef __ODBCXX_TYPES_H
23 #define __ODBCXX_TYPES_H
28 #if !defined(ODBCXX_QT)
35 #if defined(ODBCXX_QT)
39 #if defined(ODBCXX_HAVE_ISQL_H) && defined(ODBCXX_HAVE_ISQLEXT_H)
42 #elif defined(ODBCXX_HAVE_SQL_H) && defined(ODBCXX_HAVE_SQLEXT_H)
46 # error "Whoops. Can not recognize the ODBC subsystem."
52 #if !defined(SQL_TRUE)
56 #if !defined(SQL_FALSE)
61 #if ODBCVER >= 0x0300 && !defined(SQL_NOT_DEFERRABLE)
62 # define SQL_NOT_DEFERRABLE 7
69 # define ODBC3_C(odbc3_value,old_value) odbc3_value
73 # define ODBC3_C(odbc3_value,old_value) old_value
85 # define ODBC3_DC(odbc3_value,old_value) \
86 (this->_getDriverInfo()->getMajorVersion()>=3?odbc3_value:old_value)
90 # define ODBC3_DC(odbc3_value,old_value) old_value
94 #if defined(ODBCXX_HAVE_INTTYPES_H)
95 # include <inttypes.h>
107 typedef __int64 Long;
109 #elif defined(ODBCXX_HAVE_INTTYPES_H)
111 typedef int64_t Long;
115 # if ODBCXX_SIZEOF_INT == 8
119 # elif ODBCXX_SIZEOF_LONG == 8
123 # elif ODBCXX_SIZEOF_LONG_LONG == 8
125 typedef long long Long;
129 # error "Can't find an appropriate at-least-64-bit integer"
199 #if !defined(ODBCXX_QT)
212 Rep(
const signed char*
b,
size_t l)
213 :len_(l), refCount_(0) {
215 buf_=
new signed char[len_];
216 memcpy((
void*)buf_,(
void*)b,len_);
230 :rep_(new
Rep(NULL,0)) {
236 :rep_(new
Rep(data,dataLen)) {
248 if(--rep_->refCount_==0) {
258 if(--rep_->refCount_==0) {
282 virtual void _invalid(
const char* what,
int value);
290 this->_invalid(
"month",m);
297 this->_invalid(
"day",d);
305 Date(
int year,
int month,
int day) {
307 this->setMonth(month);
351 virtual void setTime(time_t
t);
354 time_t getTime()
const;
376 year_=this->_validateYear(year);
381 month_=this->_validateMonth(month);
386 day_=this->_validateDay(day);
400 virtual void _invalid(
const char* what,
int value);
404 this->_invalid(
"hour",h);
411 this->_invalid(
"minute",m);
418 this->_invalid(
"second",s);
425 Time(
int hour,
int minute,
int second) {
427 this->setMinute(minute);
428 this->setSecond(second);
457 second_(t.second_) {}
471 virtual void setTime(time_t
t);
474 time_t getTime()
const;
496 hour_=this->_validateHour(h);
501 minute_=this->_validateMinute(m);
506 second_=this->_validateSecond(s);
519 virtual void _invalid(
const char* what,
int value);
523 this->_invalid(
"nanoseconds",n);
531 int hour,
int minute,
int second,
533 :
Date(year,month,day),
Time(hour,minute,second) {
534 this->setNanos(nanos);
562 :
Date(t),
Time(t),nanos_(t.nanos_) {}
576 virtual void setTime(time_t
t);
594 nanos_=this->_validateNanos(nanos);
613 typename std::vector<T>::iterator
i=this->
begin();
614 typename std::vector<T>::iterator
end=this->
end();
630 char state_[SQL_SQLSTATE_SIZE+1];
631 char description_[SQL_MAX_MESSAGE_LENGTH];
660 #if defined(ODBCXX_QT)
672 #
if defined(ODBCXX_QT)
673 ,reason8_(reason.local8Bit())
706 virtual const char*
what()
const throw() {
709 #if defined(ODBCXX_QT)
710 return reason8_.data();
768 #endif // __ODBCXX_TYPES_H