NCBI C++ ToolKit
Macros | Functions | Variables
types.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbitime.hpp>
#include <dbapi/driver/interfaces.hpp>
#include <dbapi/driver/dbapi_object_convert.hpp>
#include <dbapi/driver/util/numeric_convert.hpp>
#include "memory_store.hpp"
#include <dbapi/driver/types.hpp>
#include <dbapi/error_codes.hpp>
#include <string.h>
+ Include dependency graph for types.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define NCBI_USE_ERRCODE_X   Dbapi_DrvrTypes
 

Functions

void s_MakeLittleEndian (TStringUCS2 &s)
 
static void CheckStringTruncation (size_t cur_len, size_t max_len)
 
static void CheckBinaryTruncation (size_t cur_len, size_t max_len)
 
 NCBI_PARAM_DEF (unsigned int, dbapi, max_logged_param_length, 255)
 
template<typename TChar >
size_t my_strnlen (const TChar *str, size_t maxlen)
 
CRef< CWStringMakeString (const string &s, string::size_type size, EEncoding enc=eEncoding_Unknown)
 
CRef< CWStringMakeString (const TStringUCS2 &s, TStringUCS2::size_type size, EEncoding enc=eEncoding_Unknown)
 
template<typename TChar >
CRef< CWStringMakeString (const TChar *s, typename basic_string< TChar >::size_type size, EEncoding enc=eEncoding_Unknown)
 
template<typename TChar >
static basic_string< TChar >::size_type get_string_size_varchar (const TChar *str, typename basic_string< TChar >::size_type len)
 
static string::size_type get_string_size_longchar (const char *str, string::size_type len)
 
static void s_DoCarry (unsigned char *product)
 
static void s_MultiplyByte (unsigned char *product, int num, const unsigned char *multiplier)
 
static char * s_ArrayToString (const unsigned char *array, int scale, char *s)
 
static int s_Div256 (const char *value, char *product, int base)
 

Variables

static int s_NumericBytesPerPrec []
 
static const unsigned int kMaxPrecision = 50
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Dbapi_DrvrTypes

Definition at line 46 of file types.cpp.

Function Documentation

◆ CheckBinaryTruncation()

static void CheckBinaryTruncation ( size_t  cur_len,
size_t  max_len 
)
static

Definition at line 527 of file types.cpp.

References ERR_POST_X, and Warning().

Referenced by CDB_Binary::SetValue(), and CDB_LongBinary::SetValue().

◆ CheckStringTruncation()

static void CheckStringTruncation ( size_t  cur_len,
size_t  max_len 
)
static

◆ get_string_size_longchar()

static string::size_type get_string_size_longchar ( const char *  str,
string::size_type  len 
)
static

Definition at line 1399 of file types.cpp.

References len, max(), my_strnlen(), NULL, and str().

◆ get_string_size_varchar()

template<typename TChar >
static basic_string<TChar>::size_type get_string_size_varchar ( const TChar str,
typename basic_string< TChar >::size_type  len 
)
static

Definition at line 1119 of file types.cpp.

References len, my_strnlen(), NULL, and str().

◆ MakeString() [1/3]

CRef<CWString> MakeString ( const string s,
string::size_type  size,
EEncoding  enc = eEncoding_Unknown 
)
inline

Definition at line 858 of file types.cpp.

References ncbi::grid::netcache::search::fields::size, and rapidjson::value.

Referenced by CDB_String::Assign(), and MakeString().

◆ MakeString() [2/3]

template<typename TChar >
CRef<CWString> MakeString ( const TChar s,
typename basic_string< TChar >::size_type  size,
EEncoding  enc = eEncoding_Unknown 
)
inline

◆ MakeString() [3/3]

CRef<CWString> MakeString ( const TStringUCS2 s,
TStringUCS2::size_type  size,
EEncoding  enc = eEncoding_Unknown 
)
inline

◆ my_strnlen()

template<typename TChar >
size_t my_strnlen ( const TChar str,
size_t  maxlen 
)
inline

Definition at line 845 of file types.cpp.

References len, and str().

Referenced by get_string_size_longchar(), get_string_size_varchar(), and MakeString().

◆ NCBI_PARAM_DEF()

NCBI_PARAM_DEF ( unsigned int  ,
dbapi  ,
max_logged_param_length  ,
255   
)

◆ s_ArrayToString()

static char* s_ArrayToString ( const unsigned char *  array,
int  scale,
char *  s 
)
static

Definition at line 2938 of file types.cpp.

References i, and kMaxPrecision.

Referenced by CDB_Numeric::Value().

◆ s_Div256()

static int s_Div256 ( const char *  value,
char *  product,
int  base 
)
static

Definition at line 2998 of file types.cpp.

References int, and rapidjson::value.

Referenced by CDB_Numeric::x_MakeFromString().

◆ s_DoCarry()

static void s_DoCarry ( unsigned char *  product)
static

Definition at line 2904 of file types.cpp.

References kMaxPrecision.

Referenced by s_MultiplyByte().

◆ s_MakeLittleEndian()

void s_MakeLittleEndian ( TStringUCS2 s)
inline

Definition at line 53 of file types.cpp.

References NON_CONST_ITERATE.

Referenced by MakeString(), CDB_Stream::x_Append(), and CWString::x_MakeUCS2LEString().

◆ s_MultiplyByte()

static void s_MultiplyByte ( unsigned char *  product,
int  num,
const unsigned char *  multiplier 
)
static

Definition at line 2915 of file types.cpp.

References i, kMaxPrecision, number, and s_DoCarry().

Referenced by CDB_Numeric::Value().

Variable Documentation

◆ kMaxPrecision

const unsigned int kMaxPrecision = 50
static

◆ s_NumericBytesPerPrec

int s_NumericBytesPerPrec[]
static
Initial value:
=
{
2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9,
10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15,
16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21,
22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26
}

Definition at line 2892 of file types.cpp.

Referenced by CDB_Numeric::Value(), and CDB_Numeric::x_MakeFromString().

Modified on Wed May 29 18:36:32 2024 by modify_doxy.py rev. 669887