string buffer bind variable structure More...
#include <ocipl.h>


Public Member Functions | |
| SqlString (int blen=OCIPL_DEFAULT_STRING_BUFFER) | |
| SqlString (const TCHAR *s) | |
| SqlString (const TCHAR *s, int blen) | |
| SqlString (const SqlString &other) | |
| ~SqlString () | |
| size_t | len () const |
| size_t | blen () const |
| size_t | alen () const |
| void | resize (size_t l) |
| void | clear () |
| TCHAR * | str () |
| TCHAR * | str (int l) |
| const TCHAR * | c_str () const |
| operator const TCHAR * () const | |
| SqlString & | operator= (const TCHAR *s) |
| SqlString & | operator= (const tstring &s) |
| bool | operator== (const TCHAR *s) const |
| bool | operator!= (const TCHAR *s) const |
| bool | operator< (const TCHAR *s) const |
| bool | is_null () const |
| bool | is_not_null () const |
| const SqlInd & | ind () const |
| SqlInd & | ind () |
Static Public Member Functions | |
| static TCHAR * | ocipl_tcscpyn (TCHAR *dest, const TCHAR *source, size_t count) |
Protected Attributes | |
| size_t | _blen |
| TCHAR * | _str |
| SqlInd | _ind |
Friends | |
| tostream & | operator<< (tostream &os, const SqlString &str) |
string buffer bind variable structure
Definition at line 1408 of file ocipl.h.
| OCIPL::SqlString::SqlString | ( | int | blen = OCIPL_DEFAULT_STRING_BUFFER ) |
[inline] |
| OCIPL::SqlString::SqlString | ( | const TCHAR * | s ) | [inline] |
| OCIPL::SqlString::SqlString | ( | const TCHAR * | s, |
| int | blen | ||
| ) | [inline] |
| OCIPL::SqlString::SqlString | ( | const SqlString & | other ) | [inline] |
| OCIPL::SqlString::~SqlString | ( | ) | [inline] |
| size_t OCIPL::SqlString::alen | ( | ) | const [inline] |
Definition at line 1449 of file ocipl.h.
Referenced by OCIPL::BindInput::BindInput(), OCIPL::BindOutput::BindOutput(), and OCIPL::DefinePar::DefinePar().
{return _blen + 1;}

| size_t OCIPL::SqlString::blen | ( | ) | const [inline] |
| const TCHAR* OCIPL::SqlString::c_str | ( | ) | const [inline] |
Definition at line 1457 of file ocipl.h.
References TEXT.
Referenced by OCIPL::BindInput::BindInput(), and OCIPL::TrimBindPar::TrimBindPar().

| void OCIPL::SqlString::clear | ( | ) | [inline] |
| 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(), OCIPL::OciDate::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] |
| size_t OCIPL::SqlString::len | ( | ) | const [inline] |
| static TCHAR* OCIPL::SqlString::ocipl_tcscpyn | ( | TCHAR * | dest, |
| const TCHAR * | source, | ||
| size_t | count | ||
| ) | [inline, static] |
| OCIPL::SqlString::operator const TCHAR * | ( | ) | const [inline] |
| bool OCIPL::SqlString::operator!= | ( | const TCHAR * | s ) | const [inline] |
| bool OCIPL::SqlString::operator< | ( | const TCHAR * | s ) | const [inline] |
| SqlString & OCIPL::SqlString::operator= | ( | const TCHAR * | s ) |
Definition at line 394 of file ocipl.cpp.
References _blen, OCIPL::SqlValue::_ind, _str, _tcscpy_s, _tcslen, resize(), and TEXT.
{
size_t l = s? _tcslen(s): 0;
if (l > _blen)
resize(l); // resize for longer new strings
_tcscpy_s(_str, _blen+1, s?s:TEXT(""));
_ind = l>0? 0: -1;
return *this;
}

Definition at line 405 of file ocipl.cpp.
References _blen, OCIPL::SqlValue::_ind, _str, and resize().
{
if (!s.empty()) {
size_t l = s.length();
if (_blen < l)
resize(l); // resize for longer new strings
memcpy(_str, s.c_str(), (l+1)*sizeof(char));
_ind = 0;
} else {
*_str = '\0';
_ind = -1;
}
return *this;
}

| bool OCIPL::SqlString::operator== | ( | const TCHAR * | s ) | const [inline] |
| void OCIPL::SqlString::resize | ( | size_t | l ) | [inline] |
Definition at line 1451 of file ocipl.h.
References ocipl_realloc, and TCHAR.
Referenced by operator=().
{void* new_ptr = ocipl_realloc(_str,(l+1)*sizeof(TCHAR)); if (new_ptr) {_str=(TCHAR*)new_ptr; _str[l]='\0'; _blen=l;}}

| TCHAR* OCIPL::SqlString::str | ( | ) | [inline] |
Definition at line 1454 of file ocipl.h.
Referenced by OCIPL::BindOutput::BindOutput(), and OCIPL::DefinePar::DefinePar().
{return _str;} // Note: _ind is not checked by this function.

| TCHAR* OCIPL::SqlString::str | ( | int | l ) | [inline] |
size_t OCIPL::SqlString::_blen [protected] |
Definition at line 1481 of file ocipl.h.
Referenced by operator=().
SqlInd OCIPL::SqlValue::_ind [protected, inherited] |
Definition at line 1248 of file ocipl.h.
Referenced by OCIPL::OciDate::OciDate(), operator=(), and OCIPL::SqlNumber::SqlNumber().
TCHAR* OCIPL::SqlString::_str [protected] |
Definition at line 1482 of file ocipl.h.
Referenced by operator=().
1.7.2