mksqlite  2.5
A MATLAB interface to SQLite
Classes | Macros | Functions | Variables
mksqlite.cpp File Reference

Main routine (mexFunction()) More...

#include "sql_interface.hpp"
+ Include dependency graph for mksqlite.cpp:

Go to the source code of this file.

Classes

class  SQLstack
 SQLite interface stack. More...
 
class  Mksqlite
 Main routine class. More...
 

Macros

#define STRMATCH(strA, strB)   ( (strA) && (strB) && ( 0 == _strcmpi( (strA), (strB) ) ) )
 Returns 0 if strA and strB are equal (ignoring case)
 
#define FINALIZE_STR(message)   mexErrMsgTxt( message )
 Terminates the function immediately with an error message.
 
#define FINALIZE(identifier)   FINALIZE_STR( ::getLocaleMsg( identifier ) )
 Terminates the function immediately with an error message.
 

Functions

void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
 MEX Entry function declared the as pure C. More...
 
void mex_module_deinit ()
 Module deinitialization. More...
 
void mex_module_init ()
 Module initialization. More...
 
ValueMex createItemFromValueSQL (const ValueSQL &value, int &err_id)
 Transfer fetched SQL value into MATLAB array. More...
 
ValueSQL createValueSQLFromItem (const ValueMex &item, bool bStreamable, int &iTypeComplexity, int &err_id)
 Transfer MATLAB array into a SQL value. More...
 

Variables

static class SQLstack SQLstack
 Holding the SQLiface slots.
 

Detailed Description

Main routine (mexFunction())

class implementations (SQLstack and Mksqlite)

Authors
Martin Kortmann mail@.nosp@m.kort.nosp@m.mann..nosp@m.de, Andreas Martin andim.nosp@m.arti.nosp@m.n@use.nosp@m.rs.s.nosp@m.ource.nosp@m.forg.nosp@m.e.net
Version
2.5
Date
2008-2017
Precondition
Warning
Bug:

Definition in file mksqlite.cpp.

Function Documentation

◆ createItemFromValueSQL()

ValueMex createItemFromValueSQL ( const ValueSQL value,
int &  err_id 
)

Transfer fetched SQL value into MATLAB array.

Parameters
[in]valueencapsulated SQL field value
[out]err_idError ID (see MSG_IDS)
Returns
a MATLAB array due to value type (string or numeric content)
See also
g_result_type

Definition at line 260 of file mksqlite.cpp.

References g_NULLasNaN, and ValueSQL::m_typeID.

◆ createValueSQLFromItem()

ValueSQL createValueSQLFromItem ( const ValueMex item,
bool  bStreamable,
int &  iTypeComplexity,
int &  err_id 
)

Transfer MATLAB array into a SQL value.

Parameters
[in]itemencapsulated MATLAB array
[in]bStreamabletrue, if serialization is active
[out]iTypeComplexitysee ValueMex::type_complexity_e
[out]err_idError ID (see MSG_IDS)
Returns
a SQL value type
See also
g_result_type

Definition at line 354 of file mksqlite.cpp.

References ValueMex::Complexity(), ValueMex::Item(), ValueMex::TC_COMPLEX, ValueMex::TC_EMPTY, and typed_blobs_mode_on().

◆ mex_module_deinit()

void mex_module_deinit ( )

Module deinitialization.

Closes all open databases and deinit blosc environment

Definition at line 190 of file mksqlite.cpp.

References SQLstack::closeAllDbs(), and getLocaleMsg().

◆ mex_module_init()

void mex_module_init ( )

Module initialization.

Get platform information and initializes blosc.

Definition at line 209 of file mksqlite.cpp.

Referenced by mexFunction().

+ Here is the caller graph for this function:

◆ mexFunction()

void mexFunction ( int  nlhs,
mxArray *  plhs[],
int  nrhs,
const mxArray *  prhs[] 
)

MEX Entry function declared the as pure C.

Entry Function of Mex-DLL.

Parameters
[in]nlhsNumber of "left hand side" parameters (expected results)
[out]plhsPointer to "left hand side" parameters
[in]nrhsNumber of "right hand side" parameters (arguments)
[in]prhsPomter to "right hand side" parameters

Definition at line 2693 of file mksqlite.cpp.

References Mksqlite::cmdExecute(), SQLstack::current(), Mksqlite::errPending(), getLocale(), mex_module_init(), Mksqlite::Release(), Mksqlite::returnWithError(), setLocale(), SQLstackitem::throwOnException(), and HeapCheck::Walk().