1 #ifndef DBAPI___VARIANT__HPP
2 #define DBAPI___VARIANT__HPP
130 static CVariant LongChar (
const char *p,
size_t len = 0);
133 static CVariant VarChar (
const char *p,
size_t len = 0);
136 static CVariant VarCharMax (
const char *p,
size_t len = 0);
142 static CVariant LongBinary (
size_t maxSize,
const void *p,
size_t len);
143 static CVariant VarBinary (
const void *p,
size_t len);
144 static CVariant VarBinaryMax (
const void *p,
size_t len);
175 Int8 GetInt8(
void)
const;
176 string GetString(
void)
const;
177 Int4 GetInt4(
void)
const;
178 Int2 GetInt2(
void)
const;
179 Uint1 GetByte(
void)
const;
180 float GetFloat(
void)
const;
181 double GetDouble(
void)
const;
182 bool GetBit(
void)
const;
183 string GetNumeric(
void)
const;
184 const CTime& GetCTime(
void)
const;
187 string AsNotNullString(
const string& v)
const;
221 size_t GetBlobSize()
const;
223 size_t Append(
const void*
buf,
size_t len);
224 size_t Append(
const string&
str);
230 bool MoveTo(
size_t pos)
const;
238 {
return GetBlobDescriptor(); }
240 {
return ReleaseBlobDescriptor(); }
244 EBulkEnc GetBulkInsertionEnc(
void)
const;
245 void SetBulkInsertionEnc(
EBulkEnc e);
256 void x_Verify_AssignType(
EDB_Type db_type,
const char* cxx_type)
const;
257 void x_Inapplicable_Method(
const char* method)
const;
305 "No blob descriptor available.");
321 "Cannot assign type '" +
string(cxx_type) +
"' to type '"
330 "CVariant::" +
string(method) +
" is not applicable to type '"
350 return v1 <
v2 || v1 ==
v2;
356 return v2 < v1 || v1 ==
v2;
@ eRetriable_No
It makes no sense to retry the action.
virtual EDB_Type GetType() const =0
static const char * GetTypeName(EDB_Type db_type, bool throw_on_unknown=true)
I_BlobDescriptor * ReleaseITDescriptor(void) const
unique_ptr< I_BlobDescriptor > m_descr
bool operator==(const CVariant &v1, const CVariant &v2)
bool operator!=(const CVariant &v1, const CVariant &v2)
I_BlobDescriptor & GetBlobDescriptor(void) const
bool operator>(const CVariant &v1, const CVariant &v2)
CDB_Object * GetData() const
void x_Inapplicable_Method(const char *method) const
void SetITDescriptor(I_BlobDescriptor *descr)
bool operator>=(const CVariant &v1, const CVariant &v2)
NCBI_EXCEPTION_DEFAULT(CVariantException, CException)
void x_Verify_AssignType(EDB_Type db_type, const char *cxx_type) const
void SetBlobDescriptor(I_BlobDescriptor *descr)
I_BlobDescriptor & GetITDescriptor(void) const
CVariant(const class CTime &v, EDateTimeFormat fmt)
bool operator<=(const CVariant &v1, const CVariant &v2)
I_BlobDescriptor * ReleaseBlobDescriptor(void) const
bool operator<(const CVariant &v1, const CVariant &v2)
class CDB_Object * m_data
virtual const char * GetType(void) const
Get class name as a string.
CException & operator=(const CException &)
Private assignment operator to prohibit assignment.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
#define EXCEPTION_VIRTUAL_BASE
Do not use virtual base classes in exception declaration at all, because in this case derived class s...
void Read(CObjectIStream &in, TObjectPtr object, const CTypeRef &type)
uint8_t Uint1
1-byte (8-bit) unsigned integer
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
basic_string< TCharUCS2 > TStringUCS2
Type for string in UCS-2 encoding.
CTime Truncate(const CTime &t)
#define NCBI_DBAPI_EXPORT
const struct ncbi::grid::netcache::search::fields::SIZE size
static PyObject * Binary(PyObject *self, PyObject *args)
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Defines: CTimeFormat - storage class for time format.
Defines Limits for the types used in NCBI C/C++ toolkit.
static const char * str(char *buf, int n)