Skip to content

Commit 6f98fbe

Browse files
committed
Added getInt64Field
1 parent 37884db commit 6f98fbe

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

CppSQLite3.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,26 @@ int CppSQLite3Query::getIntField(const char* szField, int nNullValue/*=0*/)
377377
}
378378

379379

380+
int CppSQLite3Query::getInt64Field(int nField, long long nNullValue/*=0*/)
381+
{
382+
if (fieldDataType(nField) == SQLITE_NULL)
383+
{
384+
return nNullValue;
385+
}
386+
else
387+
{
388+
return sqlite3_column_int64(mpVM, nField);
389+
}
390+
}
391+
392+
393+
int CppSQLite3Query::getInt64Field(const char* szField, long long nNullValue/*=0*/)
394+
{
395+
int nField = fieldIndex(szField);
396+
return getIntField(nField, nNullValue);
397+
}
398+
399+
380400
double CppSQLite3Query::getFloatField(int nField, double fNullValue/*=0.0*/)
381401
{
382402
if (fieldDataType(nField) == SQLITE_NULL)

CppSQLite3.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ class CppSQLite3Query
119119

120120
int getIntField(int nField, int nNullValue=0);
121121
int getIntField(const char* szField, int nNullValue=0);
122+
123+
int getInt64Field(int nField, long long nNullValue=0);
124+
int getInt64Field(const char* szField, long long nNullValue=0);
122125

123126
double getFloatField(int nField, double fNullValue=0.0);
124127
double getFloatField(const char* szField, double fNullValue=0.0);

0 commit comments

Comments
 (0)