A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/ctlib_2result_8cpp_source.html below:

NCBI C++ ToolKit: src/dbapi/driver/ctlib/result.cpp Source File

39 #define NCBI_USE_ERRCODE_X Dbapi_CTlib_Results 41 #undef NCBI_DATABASE_THROW 42 #undef NCBI_DATABASE_RETHROW 44 #define NCBI_DATABASE_THROW(ex_class, message, err_code, severity) \ 45  NCBI_DATABASE_THROW_ANNOTATED(ex_class, message, err_code, severity, \ 46  GetDbgInfo(), GetConnection(), GetLastParams()) 47 #define NCBI_DATABASE_RETHROW(prev_ex, ex_class, message, err_code, severity) \ 48  NCBI_DATABASE_RETHROW_ANNOTATED(prev_ex, ex_class, message, err_code, \ 49  severity, GetDbgInfo(), GetConnection(), GetLastParams()) 54 namespace

NCBI_NS_FTDS_CTLIB

56 #define MAX_VARCHAR_SIZE 8000 58 #define MAX_VARCHAR_SIZE 1900 89  bool

buff_is_full =

false

;

94  for

(

unsigned int

nof_item = 0; nof_item < (

unsigned int

) nof_cols; nof_item++) {

113

&&

m_ColFmt

[nof_item].maxlength >= 0) {

130  if

(

m_ColFmt

[nof_item].maxlength > 2048

133

buff_is_full =

true

;

139

buff_is_full =

true

;

194 #if defined(CS_DATE_TYPE) || defined(CS_TIME_TYPE) \ 195  || defined(CS_BIGDATETIME_TYPE) || defined(CS_BIGTIME_TYPE) 202 # ifdef CS_BIGDATETIME_TYPE 205 # ifdef CS_BIGTIME_TYPE 212 #ifdef CS_USMALLINT_TYPE 221 #ifdef CS_BIGINT_TYPE 224 #ifdef CS_UBIGINT_TYPE 293  "You need to cancel the command."

+

343

is_null = (*outlen == 0);

374  if

(!

buffer

|| (buflen < 1)) {

430 #ifdef CS_USMALLINT_TYPE 438 #ifdef CS_BIGINT_TYPE 441 #ifdef CS_UBIGINT_TYPE 458 #ifdef CS_BIGDATETIME_TYPE 461 #ifdef CS_BIGTIME_TYPE 488  bool

is_null =

false

;

491  "Unsupported result type " 496  if

(maxlength >=

kMax_Int

>> 1 || maxlength == -1) {

503  if

(item_buf !=

NULL

) {

504

b_type = item_buf->

GetType

();

522  if

(item_buf ==

NULL

) {

525

b_type = item_buf->

GetType

();

527  "Wrong type of CDB_Object."

, 130020);

531 #define ENSURE_ITEM() \ 532  if (item_buf == NULL) { \ 533  auto_item.reset(CDB_Object::Create(b_type, maxlength)); \ 534  item_buf = auto_item.get(); \ 535  _ASSERT(item_buf->IsNULL()); \ 536  } else if (is_null) { \ 537  item_buf->AssignNULL(); \ 543  switch

( datatype ) {

557

auto_buf.

reset

(

new char

[maxlength + 1]);

558

v = auto_buf.

get

();

575  "Invalid conversion to CDB_VarChar type."

, 230021);

581  "Invalid conversion to CDB_VarChar type."

, 230022);

589  static_cast<CDB_String

*

>

(item_buf)->Assign(v

);

592  static_cast<CDB_VarBinary

*

>

(item_buf)->SetValue(v, outlen);

595  static_cast<CDB_Binary

*

>

(item_buf)->SetValue(v, outlen);

608 #ifdef CS_USMALLINT_TYPE 616 #ifdef CS_BIGINT_TYPE 619 #ifdef CS_UBIGINT_TYPE 628 #ifdef CS_USMALLINT_TYPE 637 #ifdef CS_BIGINT_TYPE 640 #ifdef CS_UBIGINT_TYPE 647 #ifdef WORDS_BIGENDIAN 648

v >>= (

sizeof

(v) - sz) *

CHAR_BIT

;

713 #if defined(CS_DATE_TYPE) || defined(CS_TIME_TYPE) \ 714  || defined(CS_BIGDATETIME_TYPE) || defined(CS_BIGTIME_TYPE) 721 # ifdef CS_BIGDATETIME_TYPE 724 # ifdef CS_BIGTIME_TYPE 740  "Failed to unpack big date/time"

, 230023);

742 #if defined(FTDS_IN_USE) && NCBI_FTDS_VERSION >= 100 743  if

(

dr

.datesecprec > 0) {

748

ns =

dr

.datemsecond * 1000 * 1000;

750  t

=

CTime

(

dr

.dateyear,

dr

.datemonth + 1,

dr

.datedmonth,

751  dr

.datehour,

dr

.dateminute,

dr

.datesecond, ns);

754  if

(

dr

.datetzone != 0 || fmt.

usertype

== 43) {

756  static_cast<short>

(

dr

.datetzone));

784

(

const unsigned char

*) v.

array

);

806

*

static_cast<CDB_Float

*

>

(item_buf) = v;

815  if

(item_buf ==

NULL

) {

817

item_buf = auto_item.

get

();

854  if

(

val

->Size() == 0) {

909  if

((

buffer

== 0) && (buffer_size == 0)) {

910  buffer

= (

void

*)(&buffer_size);

936

*is_null = (outlen == 0);

951  return

(

size_t

) outlen;

971  bool

is_null =

false

;

991

desc->m_Desc.textptrlen = 0;

1000  if

(memcmp(desc->m_Desc.textptr,

"dummy textptr\0\0"

, 16) == 0) {

1001

desc->m_Desc.textptrlen = 0;

1003  if

(desc->m_Desc.textptrlen <= 0) {

1004

desc->m_Context.reset

1011  return

desc.release();

1047  CS_INT

err_code = 130007;

1049

&err_code, (

CS_INT

)

sizeof

(err_code), 0));

1095  bool

is_null =

false

;

1115

(*it)->Invalidate();

1152  if

(desc.m_Context.get() !=

NULL

) {

1153

m_Context.reset(desc.m_Context->Clone());

1178  const string

& column_name,

1181  "CURRENT OF "

+ cursor_result.GetCursorName()),

1182

m_CursorResult(&cursor_result)

1210  const string

& cursor_name) :

1215

m_ReadBuffer(

NULL

),

1216

m_CursorName(cursor_name)

1250  return result

.GetBlobDescriptor();

1258  bool

fetch_succeeded =

false

;

1263  while

(

GetCmd

().HasMoreResults()) {

1268  if

(fetch_succeeded)

1281  if

(!fetch_succeeded)

1288  bool

need_textptrs =

false

;

1291  for

(

int i

= 0;

i

< col_cnt; ++

i

) {

1298

->m_Desc.textptrlen <= 0)) {

1299

need_textptrs =

true

;

1313  while

(

GetCmd

().HasMoreResults()) {

1314

unique_ptr<CDB_Result> res(

GetCmd

().Result() );

1316  while

(res->Fetch())

1321  if

(need_textptrs) {

1361  size_t

total_read = 0;

1405  if

(!

buffer

|| buffer_size == 0)

1415  size_t

max_size = 0;

1420  data

=

static_cast<CDB_Int

*

>

(field)->BindVal();

1437

max_size = c_field->

Size

();

1438  data

=

static_cast<const void

*

>

(c_field->

Data

());

1443

max_size = vb_field->

Size

();

1444  data

=

static_cast<const void

*

>

(vb_field->

Value

());

1449

max_size = b_field->

Size

();

1450  data

=

static_cast<const void

*

>

(b_field->

Value

());

1454

max_size =

sizeof

(float);

1458

max_size =

sizeof

(double);

1465

max_size =

sizeof

(datetime);

1469 #ifdef CS_BIGDATETIME_TYPE 1490  "Failed to unpack big date/time"

, 230023);

1491

max_size =

sizeof

(daterec);

1500

max_size =

sizeof

(datetime4);

1509

max_size = str_field->

Size

();

1520  data

=

static_cast<CDB_Bit

*

>

(field)->BindVal();

1527

max_size =

sizeof

(numeric);

1534  data

=

static_cast<const void

*

>

(lc_field->

Data

());

1539

max_size = lb_field->

Size

();

1540  data

=

static_cast<const void

*

>

(lb_field->

Value

());

1548  if

(copied > buffer_size)

1549

copied = buffer_size;

virtual int DescriptorType(void) const

virtual ~CTL_BlobDescriptor(void)

virtual EDB_ResType ResultType(void) const

Get type of the result.

const CTLibContext & GetCTLibContext(void) const

void CompleteBlobDescriptors(vector< I_BlobDescriptor * > &descs, const string &cursor_name)

int DescriptorType(void) const

CTL_CursorBlobDescriptor(CTL_CursorResult &cursor_result, const string &table_name, const string &column_name, CS_INT datatype)

~CTL_CursorBlobDescriptor()

CTL_CursorResult * m_CursorResult

virtual bool SkipItem(void)

Skip result item.

vector< I_BlobDescriptor * > m_BlobDescrs

virtual CDB_Object * GetItem(CDB_Object *item_buff=0, I_Result::EGetItem policy=I_Result::eAppendLOB)

Get a result item (you can use either GetItem or ReadItem).

CTL_LangCmd & GetCmd(void)

virtual size_t ReadItem(void *buffer, size_t buffer_size, bool *is_null=0)

Read a result item body (for BLOB columns, mostly).

vector< CDB_Object * > m_Fields

virtual int GetColumnNum(void) const

Return number of columns in the recordset.

virtual I_BlobDescriptor * GetBlobDescriptor(void)

Get a descriptor for a BLOB column (for SendData).

virtual bool Fetch(void)

Fetch next row.

virtual ~CTL_CursorResultExpl(void)

virtual EDB_ResType ResultType(void) const

Get type of the result.

virtual int CurrentItemNo(void) const

Return current item number we can retrieve (0,1,...) Return "-1" if no more items left (or available)...

virtual ~CTL_CursorResult(void)

virtual bool SkipItem(void)

Skip result item.

virtual EDB_ResType ResultType(void) const

Get type of the result.

void x_InvalidateDescriptors(void)

virtual bool Fetch(void)

Fetch next row.

void RegisterDescriptor(CTL_CursorBlobDescriptor &desc)

void UnregisterDescriptor(CTL_CursorBlobDescriptor &desc)

set< CTL_CursorBlobDescriptor * > m_Descriptors

virtual bool Send(void)

Send command to the server.

virtual CDB_Result * Result(void)

Get result set.

virtual EDB_ResType ResultType(void) const

Get type of the result.

unsigned char m_BindBuff[2048]

CTL_RowResult(CS_COMMAND *cmd, CTL_Connection &conn)

AutoArray< CS_VOID * > m_BindItem

AutoArray< CS_DATAFMT > m_ColFmt

AutoArray< ENullValue > m_NullValue

virtual bool Fetch(void)

Fetch next row.

void SetCurrentItemNum(int num)

void CheckIsDead(void) const

static EDB_Type ConvDataType_Ctlib2DBAPI(const CS_DATAFMT &fmt)

AutoArray< CS_SMALLINT > m_Indicator

virtual ~CTL_RowResult(void)

virtual CDB_Object * GetItem(CDB_Object *item_buf=0, I_Result::EGetItem policy=I_Result::eAppendLOB)

Get a result item (you can use either GetItem or ReadItem).

CDB_Object * GetItemInternal(I_Result::EGetItem policy, CS_COMMAND *cmd, CS_INT item_no, CS_DATAFMT &fmt, CDB_Object *item_buf)

CTL_Connection * m_Connect

virtual I_BlobDescriptor * GetBlobDescriptor(void)

Get a descriptor for a BLOB column (for SendData).

CTL_Connection & GetConnection(void)

CS_RETCODE Check(CS_RETCODE rc)

AutoArray< CS_INT > m_Copied

CS_COMMAND * x_GetSybaseCmd(void) const

virtual int CurrentItemNo(void) const

Return current item number we can retrieve (0,1,...) Return "-1" if no more items left (or available)...

const CDBParams * GetLastParams(void) const

const CTL_Connection::TDbgInfo & GetDbgInfo(void) const

virtual bool SkipItem(void)

Skip result item.

void IncCurrentItemNum(void)

virtual int GetColumnNum(void) const

Return number of columns in the recordset.

friend class CTL_CursorResultExpl

virtual size_t ReadItem(void *buffer, size_t buffer_size, bool *is_null=0)

Read a result item body (for BLOB columns, mostly).

CS_RETCODE my_ct_get_data(CS_COMMAND *cmd, CS_INT item, CS_VOID *buffer, CS_INT buflen, CS_INT *outlen, bool &is_null)

virtual EDB_ResType ResultType(void) const

Get type of the result.

int GetCurrentItemNum(void) const

virtual EDB_ResType ResultType(void) const

Get type of the result.

virtual CS_CONTEXT * CTLIB_GetContext(void) const

void Add(const string &name, size_t max_size, EDB_Type data_type=eDB_UnsupportedType, EDirection direction=eOut) const

virtual const CDBParams & GetDefineParams(void) const

CCachedRowInfo m_CachedRowInfo

static NCBI_SUSPEND_DEPRECATION_WARNINGS I_BlobDescriptor * s_GetBlobDescriptor(I_Result &result)

static bool s_CanStore(CS_INT src, EDB_Type dst)

static bool s_IsBlob(const CS_DATAFMT &fmt)

#define CTL_BLOB_DESCRIPTOR_TYPE_CURSOR

#define CTL_BLOB_DESCRIPTOR_TYPE_MAGNUM

#define CS_DATETIME4_TYPE

#define CS_LONGBINARY_TYPE

#define CS_BIGDATETIME_TYPE

#define CS_USMALLINT_TYPE

#define CS_VARBINARY_TYPE

#define CS_CANCEL_CURRENT

struct _cs_numeric CS_NUMERIC

static CS_CONNECTION * conn

CS_RETCODE ct_results(CS_COMMAND *cmd, CS_INT *result_type)

CS_RETCODE ct_res_info(CS_COMMAND *cmd, CS_INT type, CS_VOID *buffer, CS_INT buflen, CS_INT *out_len)

CS_RETCODE ct_fetch(CS_COMMAND *cmd, CS_INT type, CS_INT offset, CS_INT option, CS_INT *rows_read)

CS_RETCODE ct_get_data(CS_COMMAND *cmd, CS_INT item, CS_VOID *buffer, CS_INT buflen, CS_INT *outlen)

CS_RETCODE ct_cmd_props(CS_COMMAND *cmd, CS_INT action, CS_INT property, CS_VOID *buffer, CS_INT buflen, CS_INT *outlen)

CS_RETCODE ct_data_info(CS_COMMAND *cmd, CS_INT action, CS_INT colnum, CS_IODESC *iodesc)

CS_RETCODE ct_bind(CS_COMMAND *cmd, CS_INT item, CS_DATAFMT *datafmt, CS_VOID *buffer, CS_INT *copied, CS_SMALLINT *indicator)

CS_RETCODE ct_cancel(CS_CONNECTION *conn, CS_COMMAND *cmd, CS_INT type)

CS_RETCODE ct_describe(CS_COMMAND *cmd, CS_INT item, CS_DATAFMT *datafmt)

static const char table_name[]

static const char * str(char *buf, int n)

void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)

Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

element_type * get(void) const

Get pointer.

element_type * get(void) const

Get pointer.

element_type * release(void)

Release will release ownership of pointer to caller.

@ eNoOwnership

No ownership is assumed.

#define DATABASE_DRIVER_ERROR(message, err_code)

#define CHECK_DRIVER_ERROR(failed, message, err_code)

#define DATABASE_DRIVER_ERROR_EX(prev_exception, message, err_code)

virtual unsigned int GetNum(void) const =0

Get total number of columns in resultset.

EDB_ResType

EDB_ResType::

virtual EDB_ResType ResultType() const

Get type of the result.

virtual int GetColumnNum(void) const

Return number of columns in the recordset.

virtual EDB_Type ItemDataType(unsigned int item_num) const

Get datatype of a result item.

virtual int CurrentItemNo() const

Return current item number we can retrieve (0,1,...)

virtual CDB_Object * GetItem(CDB_Object *item_buf=0, EGetItem policy=eAppendLOB)

Get a result item (you can use either GetItem or ReadItem).

void SetColumnType(ETDescriptorType type)

virtual const CDBParams & GetDefineParams(void) const

Get meta-information about rows in resultset.

virtual bool Fetch()

Fetch next row.

static bool IsBlobType(EDB_Type db_type)

Uint2 GetMinutes(void) const

const void * Value() const

const unsigned char * RawData() const

virtual size_t Append(const void *buff, size_t nof_bytes)

const void * Value() const

static CDB_Object * Create(EDB_Type type, size_t size=1)

virtual EDB_Type GetType() const =0

const CTime & GetCTime(void) const

virtual bool MoveTo(size_t byte_number)

Uint2 GetDays(void) const

virtual void AssignValue(const CDB_Object &v)=0

ESQLType GetSQLType(void) const

CDB_BigDateTime & Assign(const CTime &t, ESQLType sql_type=eDateTime, TOffset offset=null)

virtual size_t Read(void *buff, size_t nof_bytes)

Int4 Get300Secs(void) const

const char * Data(void) const

virtual size_t Size() const

const void * Value() const

#define DIAG_COMPILE_INFO

Make compile time diagnostic information object to use in CNcbiDiag and CException.

#define NCBI_CURRENT_FUNCTION

Get current function name.

@ eDiag_Error

Error message.

#define NCBI_CATCH_ALL_X(err_subcode, message)

int16_t Int2

2-byte (16-bit) signed integer

int32_t Int4

4-byte (32-bit) signed integer

#define NCBI_RESUME_DEPRECATION_WARNINGS

#define NCBI_SUSPEND_DEPRECATION_WARNINGS

int64_t Int8

8-byte (64-bit) signed integer

int8_t Int1

1-byte (8-bit) signed integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)

Convert numeric value to string.

const char *const kEmptyCStr

Empty "C" string (points to a '\0').

const long kMicroSecondsPerSecond

Number of microseconds in one second.

const long kNanoSecondsPerSecond

Number of nanoseconds in one second.

unsigned int

A callback function used to compare two keys in a database.

Definition of all error codes used in dbapi libraries (dbapi_driver.lib and others).

Int8 numeric_to_longlong(unsigned int precision, unsigned char *cs_num)

static size_t read_size(CNcbiIstream &stream, const char *name)

static sljit_uw total_size

Database format for time where day and time is signed 32 bit.

Database format for time where day and time is unsigned 16 bit.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4