Ejemplo n.º 1
0
const char* GnSQLiteTable::GetStringField(const char* szField, const char* szNullValue/*=""*/)
{
	if ( FieldIsNull(szField) )
	{
		return szNullValue;
	}
	else
	{
		return FieldValue(szField);
	}
}
Ejemplo n.º 2
0
double GnSQLiteTable::GetFloatField(const char* szField, double fNullValue/*=0.0*/)
{
	if ( FieldIsNull(szField) )
	{
		return fNullValue;
	}
	else
	{
		return atof( FieldValue(szField) );
	}
}
Ejemplo n.º 3
0
double GnSQLiteTable::GetFloatField(int nField, double fNullValue/*=0.0*/)
{
	if ( FieldIsNull( nField ) )
	{
		return fNullValue;
	}
	else
	{
		return atof( FieldValue( nField ) );
	}
}
Ejemplo n.º 4
0
int GnSQLiteTable::GetIntField(const char* szField, int nNullValue/*=0*/)
{
	if ( FieldIsNull( szField ) )
	{
		return nNullValue;
	}
	else
	{
		return atoi( FieldValue( szField ) );
	}
}
Ejemplo n.º 5
0
int GnSQLiteTable::GetIntField(int nField, int nNullValue/*=0*/)
{
	if ( FieldIsNull( nField ) )
	{
		return nNullValue;
	}
	else
	{
		return atoi( FieldValue( nField ) );
	}
}
Ejemplo n.º 6
0
bool CppSQLite3Table::GetStringField(const char *szField, char *&rDset)
{
	if (FieldIsNull(szField))
	{
		return false;
	}
	else
	{
		rDset = const_cast<char *>(ValueOfField(szField));
		return true;
	}
}
Ejemplo n.º 7
0
bool CppSQLite3Table::GetStringField(int nField, char *&rDest)
{
	if (FieldIsNull(nField))
	{
		return false;
	}
	else
	{
		rDest = const_cast<char *>(ValueOfField(nField));
		return true;
	}
}
Ejemplo n.º 8
0
bool CppSQLite3Table::GetFloatField(const char *szField, double &rDest)
{
	if (FieldIsNull(szField))
	{
		return false;
	}
	else
	{
		rDest = atof(ValueOfField(szField));
		return true;
	}
}
Ejemplo n.º 9
0
bool CppSQLite3Table::GetIntField(const char *szField, int &rDest)
{
	if (FieldIsNull(szField))
	{
		return false;
	}
	else
	{
		rDest = atoi(ValueOfField(szField));
		return true;
	}
}
Ejemplo n.º 10
0
bool CppSQLite3Table::GetFloatField(int nField, double &rDest)
{
	if (FieldIsNull(nField))
	{
		return false;
	}
	else
	{
		//C库函数,将数值型字符串转换为浮点数  
		rDest = atof(ValueOfField(nField));
		return true;
	}
}
Ejemplo n.º 11
0
//这里的获取具体类型数值函数,需要用户对数据库中的表有一定的了解,知道哪些字段存储的是什么内容  
//并且使用的是外部传递引用的形式  
bool CppSQLite3Table::GetIntField(int nField, int &rDest)
{
	if (FieldIsNull(nField))
	{
		return false;
	}
	else
	{
		//atoi()函数是C库函数,讲数值型字符串转换为整型值  
		rDest = atoi(ValueOfField(nField));
		return true;
	}
}