本文整理汇总了C++中CVariant::GetByte方法的典型用法代码示例。如果您正苦于以下问题:C++ CVariant::GetByte方法的具体用法?C++ CVariant::GetByte怎么用?C++ CVariant::GetByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVariant
的用法示例。
在下文中一共展示了CVariant::GetByte方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
bool operator==(const CVariant& v1, const CVariant& v2)
{
bool less = false;
if( v1.IsNull() || v2.IsNull() ) {
less = v1.IsNull() && !v2.IsNull();
}
else {
if( v1.GetType() != v2.GetType() ) {
NCBI_THROW(CVariantException, eVariant, "Cannot compare different types");
}
switch( v1.GetType() ) {
case eDB_Char:
case eDB_VarChar:
case eDB_LongChar:
case eDB_Binary:
case eDB_VarBinary:
less = v1.GetString() == v2.GetString();
break;
case eDB_Bit:
less = v1.GetBit() == v2.GetBit();
break;
case eDB_TinyInt:
less = v1.GetByte() == v2.GetByte();
break;
case eDB_SmallInt:
less = v1.GetInt2() == v2.GetInt2();
break;
case eDB_Int:
less = v1.GetInt4() == v2.GetInt4();
break;
case eDB_BigInt:
less = v1.GetInt8() == v2.GetInt8();
break;
case eDB_Float:
less = v1.GetFloat() == v2.GetFloat();
break;
case eDB_Double:
less = v1.GetDouble() == v2.GetDouble();
break;
case eDB_DateTime:
case eDB_SmallDateTime:
less = v1.GetCTime() == v2.GetCTime();
break;
default:
NCBI_THROW(CVariantException, eVariant, "Type not supported");
}
}
return less;
}