Example #1
0
bool CppSQLite3Query::GetStringValue(int nField, char *&rDest)
{
	if (FieldDataType(nField) == SQLITE_NULL)
	{
		return false;
	}
	else
	{
		rDest = const_cast<char *>((const char*)sqlite3_column_text(mpStmt, nField));
		return true;
	}
}
Example #2
0
bool CppSQLite3Query::GetFloatValue(int nField, double &rDest)
{
	if (FieldDataType(nField) == SQLITE_NULL)
	{
		return false;
	}
	else
	{
		rDest = sqlite3_column_double(mpStmt, nField);
		return true;
	}
}
Example #3
0
ColumnType RecordBase::FieldDataType
(
	const QString& fieldName
) 
{	
	for (quint32 i(1); i < Count(); i++) 
	{
		if (fieldName.toLower() == Field(i).toLower()) 
			 return FieldDataType(i);
	}

	return eUnknown;
}
// -----------------------------------------------------------------------------
// PosGenericInfoUser::CopyField
// -----------------------------------------------------------------------------
//
TInt PosGenericInfoUser::CopyField( 
            const HPositionGenericInfo& aSrc,
            HPositionGenericInfo& aDes,
            TInt aFieldId )
    {
    //Get field data type
    TInt dataType;
    TBool isList;
    TInt err( KErrNone );
    err = FieldDataType( aFieldId, dataType, isList );
    if ( err != KErrNone )
        {
        return err;
        }
        
    if ( isList )
        {
        //copy list
        TUint8 count; //length of the list
        err = aSrc.GetValue( aFieldId, count );
        if ( err != KErrNone )
            {
            return err;
            }
        for ( TInt i = 0; i < count; i++ )
            {
            err = CopyDataByType( aSrc, aDes, aFieldId + 1 + i, dataType );
            if ( err != KErrNone )
                {
                return err;
                }
            }
            
        err = aDes.SetValue( aFieldId, count );
        }
    else
        {
        err = CopyDataByType( aSrc, aDes, aFieldId, dataType );
        }
        
    return err;
    }
Example #5
0
bool CppSQLite3Query::FieldIsNull(const char *szField)
{
	int nField = FieldIndex(szField);
	return (FieldDataType(nField) == SQLITE_NULL);
}
Example #6
0
bool CppSQLite3Query::FieldIsNull(int nField)
{
	return (FieldDataType(nField) == SQLITE_NULL);
}