mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
.Sqlite3 improvements
git-svn-id: svn://ultimatepp.org/upp/trunk@2446 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
25d904e0d2
commit
78bb810b84
3 changed files with 78 additions and 60 deletions
|
|
@ -126,12 +126,15 @@ int ParseForArgs(const char* sqlcmd)
|
|||
if(*ptr == '\'')
|
||||
while(*++ptr && (*ptr != '\'' || *++ptr && *ptr == '\''))
|
||||
;
|
||||
else if(*ptr == '-' && *++ptr && *ptr == '-')
|
||||
else if(*ptr == '-' && *(ptr+1) == '-')
|
||||
while(*++ptr && *ptr != '\n' && *ptr != '\r')
|
||||
;
|
||||
else if(*ptr == '/' && *++ptr && *ptr == '*')
|
||||
while(*++ptr && *ptr != '*' && *++ptr && *ptr != '/')
|
||||
else if(*ptr == '/' && *(ptr+1) == '*')
|
||||
{
|
||||
ptr++;
|
||||
while(*++ptr && (*ptr != '*' || (*(ptr+1) && *(ptr+1) != '/')))
|
||||
;
|
||||
}
|
||||
else if(*ptr++ == '?')
|
||||
++numargs;
|
||||
return numargs;
|
||||
|
|
@ -201,7 +204,22 @@ bool Sqlite3Connection::Execute() {
|
|||
field.type = WSTRING_V;
|
||||
break;
|
||||
case SQLITE_NULL:
|
||||
field.type = VOID_V;
|
||||
if(coltype == "date")
|
||||
field.type = DATE_V;
|
||||
else
|
||||
if(coltype == "datetime")
|
||||
field.type = TIME_V;
|
||||
else
|
||||
if(coltype.Find("char") >= 0 || coltype.Find("text") >= 0 )
|
||||
field.type = WSTRING_V;
|
||||
else
|
||||
if(coltype.Find("integer") >= 0)
|
||||
field.type = INT_V;
|
||||
else
|
||||
if(coltype.Find("real") >= 0)
|
||||
field.type = DOUBLE_V;
|
||||
else
|
||||
field.type = VOID_V;
|
||||
break;
|
||||
case SQLITE_BLOB:
|
||||
field.type = STRING_V;
|
||||
|
|
|
|||
Loading…
Reference in a new issue