From: <mrj...@us...> - 2008-01-19 01:42:40
|
Revision: 2446 http://tora.svn.sourceforge.net/tora/?rev=2446&view=rev Author: mrjohnson0 Date: 2008-01-18 17:42:37 -0800 (Fri, 18 Jan 2008) Log Message: ----------- add isNumber() Modified Paths: -------------- branches/tora-1.4/tora/src/toconnection.cpp branches/tora-1.4/tora/src/toqvalue.h Modified: branches/tora-1.4/tora/src/toconnection.cpp =================================================================== --- branches/tora-1.4/tora/src/toconnection.cpp 2008-01-19 00:12:47 UTC (rev 2445) +++ branches/tora-1.4/tora/src/toconnection.cpp 2008-01-19 01:42:37 UTC (rev 2446) @@ -293,6 +293,23 @@ return *this; } +bool toQValue::isNumber() const { + switch (Type) { + case intType: + case doubleType: + case nullType: // intentional fall through + case longType: + case ulongType: + return true; + + case stringType: // intentional + case binaryType: + return false; + } + + return false; +} + bool toQValue::operator == (const toQValue &val) const { if (isNull() && val.isNull()) return true; Modified: branches/tora-1.4/tora/src/toqvalue.h =================================================================== --- branches/tora-1.4/tora/src/toqvalue.h 2008-01-19 00:12:47 UTC (rev 2445) +++ branches/tora-1.4/tora/src/toqvalue.h 2008-01-19 01:42:37 UTC (rev 2446) @@ -130,6 +130,9 @@ /** Check if this value is null. */ bool isNull(void) const; + /** Check if this value is one of the number types. Returns true for NULL. + */ + bool isNumber(void) const; /** Check if this value is binary. */ bool isBinary(void) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |