Commit 9cd59427 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

more precise error name

parent c1eab057
......@@ -9,7 +9,7 @@ QIdentifierLiteral qBindExpectedBytes ("ExpectedBytes" );
QIdentifierLiteral qBindExpectedInteger ("ExpectedInteger" );
QIdentifierLiteral qBindExpectedDecimal ("ExpectedDecimal" );
QIdentifierLiteral qBindExpectedSmallerNumber ("ExpectedSmallerNumber" );
QIdentifierLiteral qBindExpectedPositiveNumber("ExpectedPositiveNumber");
QIdentifierLiteral qBindExpectedPositiveInteger("ExpectedPositiveInteger");
QIdentifierLiteral qBindExpectedBoolean ("ExpectedBoolean" );
QIdentifierLiteral qBindExpectedConstant ("ExpectedConstant" );
......
......@@ -63,7 +63,7 @@ extern QIdentifierLiteral qBindExpectedBytes ;
extern QIdentifierLiteral qBindExpectedInteger ;
extern QIdentifierLiteral qBindExpectedDecimal ;
extern QIdentifierLiteral qBindExpectedSmallerNumber ;
extern QIdentifierLiteral qBindExpectedPositiveNumber;
extern QIdentifierLiteral qBindExpectedPositiveInteger;
extern QIdentifierLiteral qBindExpectedBoolean ;
extern QIdentifierLiteral qBindExpectedConstant ;
......
This diff is collapsed.
......@@ -355,7 +355,7 @@ protected:
bool _bind ( quint64& t) { if (caching) { cacheLevel++; return caching->_bind(t) && cacheOut(); }
quint64 i; bool neg;
if (!getInteger(i,neg)) { _reportError(qBindExpectedInteger ); return false; }
if ( neg ) { _reportError(qBindExpectedPositiveNumber); return false; }
if ( neg ) { _reportError(qBindExpectedPositiveInteger); return false; }
t=i; return true; }
bool _bind ( qint64& t) { if (caching) { cacheLevel++; return caching->_bind(t) && cacheOut(); }
quint64 i; bool neg;
......
......@@ -300,7 +300,7 @@ protected:
auto r=getNumber();
if (r==None) return false; // already reported qBindExpectedDecimal
if (r==FloatingPoint) { _reportError(qBindExpectedInteger); return false; }
if (neg) { _reportError(qBindExpectedPositiveNumber); return false; }
if (neg) { _reportError(qBindExpectedPositiveInteger); return false; }
t = i ; cachedNumber=None; return true; }
bool _bind ( qint64& t) { if (caching) { cacheLevel++; return caching->_bind(double(t)) && cacheOut(); }
auto r=getNumber();
......
......@@ -123,10 +123,10 @@ protected:
bool _bind( qint16& t) { return set(t, qBindExpectedInteger ); }
bool _bind( qint32& t) { return set(t, qBindExpectedInteger ); }
bool _bind( qint64& t) { return set(t, qBindExpectedInteger ); }
bool _bind( quint8& t) { return set(t, qBindExpectedPositiveNumber); }
bool _bind( quint16& t) { return set(t, qBindExpectedPositiveNumber); }
bool _bind( quint32& t) { return set(t, qBindExpectedPositiveNumber); }
bool _bind( quint64& t) { return set(t, qBindExpectedPositiveNumber); }
bool _bind( quint8& t) { return set(t, qBindExpectedPositiveInteger); }
bool _bind( quint16& t) { return set(t, qBindExpectedPositiveInteger); }
bool _bind( quint32& t) { return set(t, qBindExpectedPositiveInteger); }
bool _bind( quint64& t) { return set(t, qBindExpectedPositiveInteger); }
bool _bind( float& t) { return set(t, qBindExpectedDecimal ); }
bool _bind( double& t) { return set(t, qBindExpectedDecimal ); }
......
......@@ -155,16 +155,16 @@ protected:
current()->type()==qMetaTypeId< qint16>()||
current()->type()==qMetaTypeId< qint32>()||
current()->type()==qMetaTypeId< qint64>()) { t = current()->value< qint64>(); return true; } _reportError(qBindExpectedInteger ); return false; }
bool _bind( quint8& t) { if (current()->type()==qMetaTypeId< quint8>()) { t = current()->value< quint8>(); return true; } _reportError(qBindExpectedPositiveNumber); return false; }
bool _bind( quint8& t) { if (current()->type()==qMetaTypeId< quint8>()) { t = current()->value< quint8>(); return true; } _reportError(qBindExpectedPositiveInteger); return false; }
bool _bind( quint16& t) { if (current()->type()==qMetaTypeId< quint8>()||
current()->type()==qMetaTypeId< quint16>()) { t = current()->value< quint16>(); return true; } _reportError(qBindExpectedPositiveNumber); return false; }
current()->type()==qMetaTypeId< quint16>()) { t = current()->value< quint16>(); return true; } _reportError(qBindExpectedPositiveInteger); return false; }
bool _bind( quint32& t) { if (current()->type()==qMetaTypeId< quint8>()||
current()->type()==qMetaTypeId< quint16>()||
current()->type()==qMetaTypeId< quint32>()) { t = current()->value< quint32>(); return true; } _reportError(qBindExpectedPositiveNumber); return false; }
current()->type()==qMetaTypeId< quint32>()) { t = current()->value< quint32>(); return true; } _reportError(qBindExpectedPositiveInteger); return false; }
bool _bind( quint64& t) { if (current()->type()==qMetaTypeId< quint8>()||
current()->type()==qMetaTypeId< quint16>()||
current()->type()==qMetaTypeId< quint32>()||
current()->type()==qMetaTypeId< quint64>()) { t = current()->value< quint64>(); return true; } _reportError(qBindExpectedPositiveNumber); return false; }
current()->type()==qMetaTypeId< quint64>()) { t = current()->value< quint64>(); return true; } _reportError(qBindExpectedPositiveInteger); return false; }
bool _bind( float& t) { if (current()->type()==qMetaTypeId< float>()) { t = current()->value< float>(); return true; } _reportError(qBindExpectedDecimal ); return false; }
bool _bind( double& t) { if (current()->type()==qMetaTypeId< float>()||
current()->type()==qMetaTypeId< double>()) { t = current()->value< double>(); return true; } _reportError(qBindExpectedDecimal ); return false; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment