SpatiaLite
4.3.0
|
Auxiliary/helper functions. More...
Go to the source code of this file.
Macros | |
#define | GAIA_SQL_SINGLE_QUOTE 1001 |
SQL single quoted string (text constant) | |
#define | GAIA_SQL_DOUBLE_QUOTE 1002 |
SQL double quoted string (SQL name) | |
Functions | |
GAIAAUX_DECLARE const char * | gaiaGetLocaleCharset (void) |
Retrieves the Locale Charset. More... | |
GAIAAUX_DECLARE int | gaiaConvertCharset (char **buf, const char *fromCs, const char *toCs) |
Converts a text string from one charset to another. More... | |
GAIAAUX_DECLARE void * | gaiaCreateUTF8Converter (const char *fromCS) |
Creates a persistent UTF8 converter object. More... | |
GAIAAUX_DECLARE void | gaiaFreeUTF8Converter (void *cvtCS) |
Destroys an UTF8 converter object. More... | |
GAIAAUX_DECLARE char * | gaiaConvertToUTF8 (void *cvtCS, const char *buf, int len, int *err) |
Converts a text string to UTF8. More... | |
GAIAAUX_DECLARE int | gaiaIsReservedSqliteName (const char *name) |
Checks if a name is a reserved SQLite name. More... | |
GAIAAUX_DECLARE int | gaiaIsReservedSqlName (const char *name) |
Checks if a name is a reserved SQL name. More... | |
GAIAAUX_DECLARE int | gaiaIllegalSqlName (const char *name) |
Checks if a name is an illegal SQL name. More... | |
GAIAAUX_DECLARE char * | gaiaSingleQuotedSql (const char *value) |
Properly formats an SQL text constant. More... | |
GAIAAUX_DECLARE char * | gaiaDoubleQuotedSql (const char *value) |
Properly formats an SQL name. More... | |
GAIAAUX_DECLARE char * | gaiaQuotedSql (const char *value, int quote) |
Properly formats an SQL generic string. More... | |
GAIAAUX_DECLARE char * | gaiaDequotedSql (const char *value) |
Properly formats an SQL generic string (dequoting) More... | |
GAIAAUX_DECLARE void | gaiaCleanSqlString (char *value) |
deprecated function More... | |
GAIAAUX_DECLARE void | gaiaInsertIntoSqlLog (sqlite3 *sqlite, const char *user_agent, const char *utf8Sql, sqlite3_int64 *sqllog_pk) |
SQL log: statement start. More... | |
GAIAAUX_DECLARE void | gaiaUpdateSqlLog (sqlite3 *sqlite, sqlite3_int64 sqllog_pk, int success, const char *errMsg) |
SQL log: statement start. More... | |
GAIAAUX_DECLARE void * | gaiaCreateMD5Checksum (void) |
Creates a persistent MD5 checksum object. More... | |
GAIAAUX_DECLARE void | gaiaFreeMD5Checksum (void *md5) |
Destroys an MD5 checksum object. More... | |
GAIAAUX_DECLARE void | gaiaUpdateMD5Checksum (void *md5, const unsigned char *blob, int blob_len) |
Updates an MD5 checksum object. More... | |
GAIAAUX_DECLARE char * | gaiaFinalizeMD5Checksum (void *md5) |
Return an MD5 checksum value. More... | |
GAIAAUX_DECLARE int | gaiaParseDMS (const char *dms, double *longitude, double *latitude) |
Return longitude and latitude angles from a DMS string. More... | |
GAIAAUX_DECLARE char * | gaiaConvertToDMS (double longitude, double latitude) |
Return a DMS string. More... | |
GAIAAUX_DECLARE char * | gaiaEncodeURL (const char *url) |
Return a percent-encoded URL. More... | |
GAIAAUX_DECLARE char * | gaiaDecodeURL (const char *encoded) |
Return a clean URL from its percent-encoded representation. More... | |
GAIAAUX_DECLARE char * | gaiaDirNameFromPath (const char *path) |
Return the DirName component (if any) from a Path. More... | |
GAIAAUX_DECLARE char * | gaiaFullFileNameFromPath (const char *path) |
Return the FullFileName from a Path. More... | |
GAIAAUX_DECLARE char * | gaiaFileNameFromPath (const char *path) |
Return the FileName from a Path. More... | |
GAIAAUX_DECLARE char * | gaiaFileExtFromPath (const char *path) |
Return the FileExtension from a Path. More... | |
Auxiliary/helper functions.
GAIAAUX_DECLARE void gaiaCleanSqlString | ( | char * | value | ) |
deprecated function
value | the string to be formatted |
GAIAAUX_DECLARE int gaiaConvertCharset | ( | char ** | buf, |
const char * | fromCs, | ||
const char * | toCs | ||
) |
Converts a text string from one charset to another.
buf | the text string to be converted |
fromCs | the GNU ICONV name identifying the input charset |
toCs | the GNU ICONV name identifying the output charset |
GAIAAUX_DECLARE char* gaiaConvertToDMS | ( | double | longitude, |
double | latitude | ||
) |
Return a DMS string.
longitude | the angle of longitude expressed in Decimal Degrees. |
latitude | the angle of latitude expressed in Decimal Degrees. |
GAIAAUX_DECLARE char* gaiaConvertToUTF8 | ( | void * | cvtCS, |
const char * | buf, | ||
int | len, | ||
int * | err | ||
) |
Converts a text string to UTF8.
cvtCS | the handle identifying the UTF8 convert object (returned by a previous call to gaiaCreateUTF8Converter). |
buf | the input text string |
len | length (in bytes) of input string |
err | on completion will contain 0 on success, any other value on failure |
GAIAAUX_DECLARE void* gaiaCreateMD5Checksum | ( | void | ) |
Creates a persistent MD5 checksum object.
GAIAAUX_DECLARE void* gaiaCreateUTF8Converter | ( | const char * | fromCS | ) |
Creates a persistent UTF8 converter object.
fromCS | the GNU ICONV name identifying the input charset |
GAIAAUX_DECLARE char* gaiaDecodeURL | ( | const char * | encoded | ) |
Return a clean URL from its percent-encoded representation.
encoded | the percent-encoded URL to be decoded |
GAIAAUX_DECLARE char* gaiaDequotedSql | ( | const char * | value | ) |
Properly formats an SQL generic string (dequoting)
value | the string to be dequoted |
GAIAAUX_DECLARE char* gaiaDirNameFromPath | ( | const char * | path | ) |
Return the DirName component (if any) from a Path.
path | full or relative pathname |
GAIAAUX_DECLARE char* gaiaDoubleQuotedSql | ( | const char * | value | ) |
Properly formats an SQL name.
value | the SQL name to be formatted |
GAIAAUX_DECLARE char* gaiaEncodeURL | ( | const char * | url | ) |
Return a percent-encoded URL.
url | the URL to be percent-encoded |
GAIAAUX_DECLARE char* gaiaFileExtFromPath | ( | const char * | path | ) |
Return the FileExtension from a Path.
path | full or relative pathname |
GAIAAUX_DECLARE char* gaiaFileNameFromPath | ( | const char * | path | ) |
Return the FileName from a Path.
path | full or relative pathname |
GAIAAUX_DECLARE char* gaiaFinalizeMD5Checksum | ( | void * | md5 | ) |
Return an MD5 checksum value.
md5 | the handle of the MD5 checksum object (returned by a previous call to gaiaCreateMD5Checksum). |
GAIAAUX_DECLARE void gaiaFreeMD5Checksum | ( | void * | md5 | ) |
Destroys an MD5 checksum object.
md5 | the handle of the MD5 checksum object (returned by a previous call to gaiaCreateMD5Checksum). |
GAIAAUX_DECLARE void gaiaFreeUTF8Converter | ( | void * | cvtCS | ) |
Destroys an UTF8 converter object.
cvtCS | the handle identifying the UTF8 convert object (returned by a previous call to gaiaCreateUTF8Converter). |
GAIAAUX_DECLARE char* gaiaFullFileNameFromPath | ( | const char * | path | ) |
Return the FullFileName from a Path.
path | full or relative pathname |
GAIAAUX_DECLARE const char* gaiaGetLocaleCharset | ( | void | ) |
Retrieves the Locale Charset.
GAIAAUX_DECLARE int gaiaIllegalSqlName | ( | const char * | name | ) |
Checks if a name is an illegal SQL name.
name | the name to be checked |
GAIAAUX_DECLARE void gaiaInsertIntoSqlLog | ( | sqlite3 * | sqlite, |
const char * | user_agent, | ||
const char * | utf8Sql, | ||
sqlite3_int64 * | sqllog_pk | ||
) |
SQL log: statement start.
sqlite | handle of the current DB connection |
user_agent | name of the invoking application, e.g. "spatialite_gui" or "spatialite CLI" |
utf8Sql | the SQL statement bein executed |
sqllog_pk | after completion this variable will contain the value of the Primary Key identifying the corresponding Log event |
GAIAAUX_DECLARE int gaiaIsReservedSqliteName | ( | const char * | name | ) |
Checks if a name is a reserved SQLite name.
name | the name to be checked |
GAIAAUX_DECLARE int gaiaIsReservedSqlName | ( | const char * | name | ) |
Checks if a name is a reserved SQL name.
name | the name to be checked |
GAIAAUX_DECLARE int gaiaParseDMS | ( | const char * | dms, |
double * | longitude, | ||
double * | latitude | ||
) |
Return longitude and latitude angles from a DMS string.
dms | a text string representing a valid DMS (Degrees/Minutes/Seconds) expression. |
longitude | on completion this variable will contain the longitude angle expressed in Decimal Degrees. |
latitude | on completion this variable will contain the latitude angle expressed in Decimal Degrees. |
GAIAAUX_DECLARE char* gaiaQuotedSql | ( | const char * | value, |
int | quote | ||
) |
Properly formats an SQL generic string.
value | the string to be formatted |
quote | GAIA_SQL_SINGLE_QUOTE or GAIA_SQL_DOUBLE_QUOTE |
GAIAAUX_DECLARE char* gaiaSingleQuotedSql | ( | const char * | value | ) |
Properly formats an SQL text constant.
value | the text string to be formatted |
GAIAAUX_DECLARE void gaiaUpdateMD5Checksum | ( | void * | md5, |
const unsigned char * | blob, | ||
int | blob_len | ||
) |
Updates an MD5 checksum object.
md5 | the handle of the MD5 checksum object (returned by a previous call to gaiaCreateMD5Checksum). |
blob | an arbitrary sequence of binary data |
blob_size | the length (in bytes) of the binary data |
GAIAAUX_DECLARE void gaiaUpdateSqlLog | ( | sqlite3 * | sqlite, |
sqlite3_int64 | sqllog_pk, | ||
int | success, | ||
const char * | errMsg | ||
) |
SQL log: statement start.
sqlite | handle of the current DB connection |
sqllog_pk | the Primary Key identifying the corresponding Log event. expected to be exactely the same returned by the most recent call to gaiaInsertIntoSqlLog() |
success | expected to be TRUE if the SQL statement was successfully executed. |
errMsg | expected to be the error message returned by SQLite on failure, NULL on success. |