Classes | Namespaces | Defines | Typedefs | Enumerations | Functions

ocipl.h File Reference

OCIPL header file. More...

#include <map>
#include <set>
#include <string>
#include <vector>
#include <ostream>
#include <sstream>
#include <exception>
#include <oci.h>
#include <wchar.h>
Include dependency graph for ocipl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OCIPL::OciException
 OCI Error handling. More...
struct  OCIPL::OciHandleID< TYPE >
 mapping between OCI handle types and the corresponding type and attribute constants More...
struct  OCIPL::OciSimpleHandle< TYPE >
 "simple" OCI handles without OciEnv More...
struct  OCIPL::OciHandleWrapper< TYPE >
 wrapping of already existing OCI handles without freeing them in destructor More...
struct  OCIPL::OciEnv
 OCI environment handles. More...
struct  OCIPL::OciEnvAlloc
 wrapper for the OCIEnv handle More...
struct  OCIPL::OciHandle< TYPE >
 OCI handles. More...
struct  OCIPL::OciDescriptor< TYPE >
 OCI descriptor handles. More...
struct  OCIPL::OracleServer
 encapsulation of the OCIServer handle, used in OCIPL::OciLogin More...
struct  OCIPL::LoginPara
 database login parameter structure More...
struct  OCIPL::OciContext
struct  OCIPL::OciLogin
 simple OCI login to database More...
struct  OCIPL::OciConnection
 wrap OCIEnv and OCISvcCtx together More...
struct  OCIPL::DatabaseConnect
 DatabaseConnect to encapsulate all structures needed to connect to an Oracle database. More...
struct  OCIPL::ColumnTypeInfo
 column type information More...
struct  OCIPL::ColumnType
 column type description including name More...
struct  OCIPL::SqlInd
 Indicator variables are used to store information about the NULL-state of bind variables and result columns. More...
struct  OCIPL::SqlValue
 base class of bind variable structures containing the indicator variable More...
struct  OCIPL::SqlIndArray
 array of indicator variables More...
struct  OCIPL::SqlInt
 int wrapper with indicator variable More...
struct  OCIPL::SqlIntArray
 array of integer bind variable buffers More...
struct  OCIPL::SqlString
 string buffer bind variable structure More...
struct  OCIPL::SqlStringArray
 array of string bind variable buffers More...
struct  OCIPL::ocidatetime
 internal DATE representation More...
struct  OCIPL::OciDate
 wrapper for OCI DATE type More...
struct  OCIPL::OciDateArray
 OCI DATE type bind variable array. More...
struct  OCIPL::SqlDateTime
 wrapper for internal Oracle DATE type More...
struct  OCIPL::SqlDateTimeArray
 wrapper for internal Oracle DATE type More...
struct  OCIPL::oraclenumber
 internal NUMBER representation More...
struct  OCIPL::SqlNumber
 wrapper for internal Oracle NUMBER type More...
struct  OCIPL::SqlNumberArray
 array of NUMBER bind variable buffers More...
struct  OCIPL::OciLob
 base class for the BLOB/CLOB data holders OCIPL::OciLob and OCIPL::OciClob More...
struct  OCIPL::OciClob
 CLOB data holder structure. More...
struct  OCIPL::BindInput
 factory for call parameters of OCI bind functions More...
struct  OCIPL::BindOutput
 factory for call parameters of OCI bind functions More...
struct  OCIPL::TrimBindPar
 Binding of input strings with trimming to the specified maximum length. More...
struct  OCIPL::DefinePar
 factory for call parameters for OCI define functions More...
struct  OCIPL::LocalOciState
struct  OCIPL::SqlStatement
 an OCI SQL statement More...
struct  OCIPL::SqlVariantArray
 variant array to be used as bind variable buffer More...
struct  OCIPL::SqlRecord
 a record to hold return columns for a given statement More...
struct  OCIPL::SqlRecord::Data
 data structure for the content of single column More...
struct  OCIPL::SqlResult
 class to retrieve query result values More...
struct  OCIPL::ResultIterator
 iterator utilizing bulk mode fetching More...

Namespaces

namespace  OCIPL

Defines

#define TCHAR   char
#define LONGLONG   long long
#define strcpy_s(d, l, s)   strcpy(d, s)
#define _strupr_s(b, s)   strupr(b)
#define _tcscpy_s(d, l, s)   _tcscpy(d, s)
#define _tcsupr_s(b, s)   _tcsupr(b)
#define _stprintf_s1(b, l, f, p1)   ((b)+(l),_stprintf(b, f, p1))
#define COUNTOF(b)   (sizeof(b)/sizeof(b[0]))
#define _countof   COUNTOF
#define min(a, b)   ((a)<(b)?(a):(b))
#define iterator   __iterator_
#define __STDC__   1
#define ORACLE_VERSION   80
#define TEXT(x)   x
#define _stprintf   sprintf
#define _tcscmp   strcmp
#define _tcscpy   strcpy
#define _tcsdup   _strdup
#define _tcslen   strlen
#define _tcsnicmp   strncasecmp
#define _tcsupr   strupr
#define _tcspbrk   strpbrk
#define _strdup   strdup
#define _snprintf   snprintf
#define ocipl_alloc   malloc
#define ocipl_realloc   realloc
#define ocipl_free   free
#define OCIPL_DEFAULT_STRING_BUFFER   2000
#define SQLCODE_DUPLICATE_KEY   1
#define SQLCODE_NO_DATA_FOUND   1403
#define SQLCODE_TOO_MANY_ROWS   1422
#define CODEPOS   __FILE__, __LINE__
#define THROW_OCI_EXCEPTION(par)   throw_ocipl_exception(OCIPL::OciException(par, CODEPOS))
#define _OCIPL_H

Typedefs

typedef OraText TOraText
typedef std::string tstring
typedef std::stringbuf tstringbuf
typedef std::ostringstream tostringstream
typedef std::istream tistream
typedef std::ostream tostream
typedef OciSimpleHandle< OCIError > OCIPL::OciError
 OCI Error Handles.
typedef OciSimpleHandle
< OCIDescribe > 
OCIPL::OciDescribe
 OCI Describe Handles.
typedef OciDescriptor< OCIParam > OCIPL::OciParam
typedef OciHandle< OCIBind > OCIPL::OciBindHandle
typedef OciHandle< OCIDefine > OCIPL::OciDefineHandle

Enumerations

enum  OCIPL::OCI_STATE {
  OCIPL::OS_NONE, OCIPL::OS_PREPARE, OCIPL::OS_RELEASE, OCIPL::OS_EXECUTE,
  OCIPL::OS_FETCH, OCIPL::OS_TRANSACTION
}
enum  { OCIPL::INT_NULL = -1 }

Functions

char * strupr (char *)
size_t max_strlen (const char *s, size_t max_len)
char * max_strdup (const char *s, size_t max_len)
int OCIPL::istspace (TCHAR c)
void OCIPL::throw_oci_exception (OCIError *errh, sword res)
void OCIPL::throw_oci_exception (OCIEnv *envh, sword res)
void OCIPL::oci_check_error (OCIError *errh, sword res)
void OCIPL::oci_check_error (OCIEnv *envh, sword res)
void OCIPL::oci_check_error (OciEnv &env, sword res)
void OCIPL::throw_ocipl_exception (OciException e)
 This function is called to throw OCIPL Exceptions in response to Oracle Errors.
tstring OCIPL::ocidate_to_string (const OCIDate &date)
tstring OCIPL::ocidate_to_short_string (const OCIDate &date)
struct tm * OCIPL::ocidate_to_gmt (const OCIDate &date)
struct tm * OCIPL::ocidate_to_lctime (const OCIDate &date)
time_t OCIPL::ocidate_to_time_t (const OCIDate &date)
tstring OCIPL::ocidatetime_to_string (const ocidatetime &date)
int OCIPL::number_to_int (const oraclenumber &val, OCIError *errh)
double OCIPL::number_to_double (const oraclenumber &val, OCIError *errh)
tstring OCIPL::number_to_str (const oraclenumber &val, OCIError *errh, const TCHAR *fmt, const TCHAR *nls_fmt)
const TCHAR * OCIPL::get_oci_ptype_str (ub1 type)

Detailed Description

OCIPL header file.

Definition in file ocipl.h.


Define Documentation

#define __STDC__   1

Definition at line 138 of file ocipl.h.

#define _countof   COUNTOF

Definition at line 114 of file ocipl.h.

#define _OCIPL_H

Definition at line 4051 of file ocipl.h.

#define _snprintf   snprintf

Definition at line 212 of file ocipl.h.

Referenced by OCIPL::OciException::OciException().

#define _stprintf   sprintf
#define _stprintf_s1 (   b,
  l,
  f,
  p1 
)    ((b)+(l),_stprintf(b, f, p1))

Definition at line 95 of file ocipl.h.

Referenced by OCIPL::SqlIntArray::str(), and OCIPL::SqlInt::str().

#define _strdup   strdup

Definition at line 208 of file ocipl.h.

Referenced by OCIPL::OciException::OciException().

#define _strupr_s (   b,
 
)    strupr(b)

Definition at line 83 of file ocipl.h.

#define _tcscmp   strcmp
#define _tcscpy   strcpy

Definition at line 199 of file ocipl.h.

#define _tcscpy_s (   d,
  l,
 
)    _tcscpy(d, s)

Definition at line 87 of file ocipl.h.

Referenced by OCIPL::SqlString::operator=().

#define _tcsdup   _strdup

Definition at line 200 of file ocipl.h.

#define _tcslen   strlen
#define _tcsnicmp   strncasecmp

Definition at line 202 of file ocipl.h.

Referenced by OCIPL::LoginPara::parse().

#define _tcspbrk   strpbrk

Definition at line 204 of file ocipl.h.

Referenced by OCIPL::tokenize().

#define _tcsupr   strupr

Definition at line 203 of file ocipl.h.

#define _tcsupr_s (   b,
 
)    _tcsupr(b)

Definition at line 91 of file ocipl.h.

Referenced by OCIPL::SqlRecord::find_column().

#define CODEPOS   __FILE__, __LINE__
#define COUNTOF (   b )    (sizeof(b)/sizeof(b[0]))
#define iterator   __iterator_
#define LONGLONG   long long

Definition at line 65 of file ocipl.h.

Referenced by OCIPL::DefinePar::DefinePar().

#define min (   a,
 
)    ((a)<(b)?(a):(b))

Definition at line 129 of file ocipl.h.

Referenced by OCIPL::TrimBindPar::TrimBindPar().

#define ocipl_alloc   malloc

Definition at line 270 of file ocipl.h.

#define OCIPL_DEFAULT_STRING_BUFFER   2000

Definition at line 286 of file ocipl.h.

#define ocipl_free   free
#define ocipl_realloc   realloc

Definition at line 271 of file ocipl.h.

Referenced by OCIPL::SqlString::resize().

#define ORACLE_VERSION   80

Definition at line 157 of file ocipl.h.

#define SQLCODE_DUPLICATE_KEY   1

Definition at line 331 of file ocipl.h.

#define SQLCODE_NO_DATA_FOUND   1403

Definition at line 332 of file ocipl.h.

#define SQLCODE_TOO_MANY_ROWS   1422

Definition at line 333 of file ocipl.h.

#define strcpy_s (   d,
  l,
 
)    strcpy(d, s)

Definition at line 79 of file ocipl.h.

Referenced by OCIPL::SqlStringArray::assign().

#define TCHAR   char
#define TEXT (   x )    x
#define THROW_OCI_EXCEPTION (   par )    throw_ocipl_exception(OCIPL::OciException(par, CODEPOS))

Typedef Documentation

typedef std::istream tistream

Definition at line 189 of file ocipl.h.

typedef OraText TOraText

Definition at line 185 of file ocipl.h.

typedef std::ostream tostream

Definition at line 190 of file ocipl.h.

typedef std::ostringstream tostringstream

Definition at line 188 of file ocipl.h.

typedef std::string tstring

Definition at line 186 of file ocipl.h.

typedef std::stringbuf tstringbuf

Definition at line 187 of file ocipl.h.


Function Documentation

char* max_strdup ( const char *  s,
size_t  max_len 
)

Definition at line 79 of file ocipl.cpp.

References max_strlen().

Referenced by OCIPL::OciException::OciException().

{
    if (!s)
        return NULL;

    size_t l = max_strlen(s, max_len);
    char* ret = (char*) malloc(l+1);

#ifdef __STDC_WANT_SECURE_LIB__
    strncpy_s(ret, l+1, s, l);
#else
    strncpy(ret, s, l);
#endif
    ret[l] = '\0';

    return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

size_t max_strlen ( const char *  s,
size_t  max_len 
)

Definition at line 66 of file ocipl.cpp.

Referenced by max_strdup(), and OCIPL::OciException::OciException().

{
    if (!s)
        return 0;

    size_t cnt = 0;

    while(cnt<max_len && *s)
        ++cnt, ++s;

    return cnt;
}

Here is the caller graph for this function:

char* strupr ( char *   )

Definition at line 57 of file ocipl.cpp.

{
    for(char*p=s; *p; ++p)
        *p = toupper(*p);

    return s;
}