![]() |
mksqlite
2.5
A MATLAB interface to SQLite
|
Utilities used in all files. More...
Go to the source code of this file.
Functions | |
char * | utils_getString (const mxArray *str) |
Copy string characters into allocated memory. More... | |
size_t | utils_elbytes (mxClassID classID) |
Get the size of one element in bytes. More... | |
void | utils_destroy_array (mxArray *&pmxarr) |
Freeing memory allocated by mxCreateNumericMatrix() or mxCreateNumericArray(). More... | |
template<class T > | |
void | utils_free_ptr (T *&pmxarr) |
Freeing memory allocated by mxAlloc() or mxRealloc() More... | |
int | utils_utf2latin (const unsigned char *s, unsigned char *buffer=NULL) |
Convert UTF-8 string to char string. More... | |
int | utils_latin2utf (const unsigned char *s, unsigned char *buffer=NULL) |
Convert char string to UTF-8 string. More... | |
char * | utils_strnewdup (const char *s, int flagConvertUTF8) |
duplicate a string and recode from UTF8 to char due to flag flagConvertUTF8 More... | |
double | utils_get_wall_time () |
Returns current counter time in seconds. More... | |
double | utils_get_cpu_time () |
Returns user mode time of current process in seconds. More... | |
char * | utils_strlwr (char *str) |
Change string to lowercase (inplace) More... | |
Utilities used in all files.
Common utilities. (freeing mex memory, utf<->latin conversion, time measurement)
Definition in file utils.hpp.
void utils_destroy_array | ( | mxArray *& | pmxarr | ) |
Freeing memory allocated by mxCreateNumericMatrix() or mxCreateNumericArray().
[in] | pmxarr | Memory pointer or NULL |
Memory pointer pmxarr
is set to NULL after deallocation.
Definition at line 302 of file utils.hpp.
Referenced by BDC_pack_time_func(), BDC_ratio_func(), BDC_unpack_time_func(), Mksqlite::createResultColNameMatrix(), ValueMex::GetString(), have_serialize(), and MD5_func().
size_t utils_elbytes | ( | mxClassID | classID | ) |
Get the size of one element in bytes.
[in] | classID | class ID |
Definition at line 75 of file utils.hpp.
Referenced by tagNativeArray::CreateArray(), and TBHData< HeaderBaseType >::getDataSize().
void utils_free_ptr | ( | T *& | pmxarr | ) |
Freeing memory allocated by mxAlloc() or mxRealloc()
[in] | pmxarr | Memory pointer or NULL |
Memory pointer pmxarr
is set to NULL after deallocation.
Definition at line 322 of file utils.hpp.
References MEM_FREE.
Referenced by ValueSQL::Destroy(), MD5_func(), regex_func(), and Mksqlite::Release().
double utils_get_cpu_time | ( | ) |
Returns user mode time of current process in seconds.
Definition at line 370 of file utils.hpp.
References utils_get_wall_time().
double utils_get_wall_time | ( | ) |
Returns current counter time in seconds.
Definition at line 350 of file utils.hpp.
Referenced by utils_get_cpu_time().
char * utils_getString | ( | const mxArray * | str | ) |
int utils_latin2utf | ( | const unsigned char * | s, |
unsigned char * | buffer = NULL |
||
) |
Convert char string to UTF-8 string.
[in] | s | input string |
[out] | buffer | optional pointer to where the string should be written (NULL allowed) |
Definition at line 171 of file utils.hpp.
Referenced by Mksqlite::cmdHandleSQLStatement(), SQLstackitem::openDb(), and regex_func().
char * utils_strlwr | ( | char * | str | ) |
char * utils_strnewdup | ( | const char * | s, |
int | flagConvertUTF8 | ||
) |
duplicate a string and recode from UTF8 to char due to flag flagConvertUTF8
[in] | s | input string |
[in] | flagConvertUTF8 | String s expected UTF8 encoded, if flag is set |
Definition at line 211 of file utils.hpp.
References MEM_ALLOC, and utils_utf2latin().
Referenced by SQLiface::fetch(), MD5_func(), and regex_func().
int utils_utf2latin | ( | const unsigned char * | s, |
unsigned char * | buffer = NULL |
||
) |
Convert UTF-8 string to char string.
[in] | s | input string UTF8 encoded |
[out] | buffer | optional pointer to where the string should be written (NULL allowed) |
Definition at line 133 of file utils.hpp.
Referenced by utils_strnewdup().