@ -433,9 +433,70 @@ bool ValueCalc::approxEqual (const Value &a, const Value &b)
return ( x < 0.0 ? - x : x ) < ( ( aa < 0.0 ? - aa : aa ) * DBL_EPSILON ) ;
}
bool ValueCalc : : strEqual ( const Value & a , const Value & b )
bool ValueCalc : : strEqual ( const Value & a , const Value & b , bool CS )
{
return ( converter - > asString ( a ) . asString ( ) = = converter - > asString ( b ) . asString ( ) ) ;
TQString aa = converter - > asString ( a ) . asString ( ) ;
TQString bb = converter - > asString ( b ) . asString ( ) ;
if ( ! CS ) {
aa = aa . lower ( ) ;
bb = bb . lower ( ) ;
}
return ( aa = = bb ) ;
}
bool ValueCalc : : strGreater ( const Value & a , const Value & b , bool CS )
{
TQString aa = converter - > asString ( a ) . asString ( ) ;
TQString bb = converter - > asString ( b ) . asString ( ) ;
if ( ! CS ) {
aa = aa . lower ( ) ;
bb = bb . lower ( ) ;
}
return ( aa > bb ) ;
}
bool ValueCalc : : strGequal ( const Value & a , const Value & b , bool CS )
{
TQString aa = converter - > asString ( a ) . asString ( ) ;
TQString bb = converter - > asString ( b ) . asString ( ) ;
if ( ! CS ) {
aa = aa . lower ( ) ;
bb = bb . lower ( ) ;
}
return ( aa > = bb ) ;
}
bool ValueCalc : : strLower ( const Value & a , const Value & b , bool CS )
{
return strGreater ( b , a , CS ) ;
}
bool ValueCalc : : naturalEqual ( const Value & a , const Value & b , bool CS )
{
if ( a . isNumber ( ) & & b . isNumber ( ) )
return approxEqual ( a , b ) ;
if ( a . allowComparison ( b ) )
return a . equal ( b ) ;
return strEqual ( a , b , CS ) ;
}
bool ValueCalc : : naturalGreater ( const Value & a , const Value & b , bool CS )
{
if ( a . isNumber ( ) & & b . isNumber ( ) )
return greater ( a , b ) ;
if ( a . allowComparison ( b ) )
return a . greater ( b ) ;
return strGreater ( a , b , CS ) ;
}
bool ValueCalc : : naturalGequal ( const Value & a , const Value & b , bool CS )
{
return naturalGreater ( a , b , CS ) | | naturalEqual ( a , b , CS ) ;
}
bool ValueCalc : : naturalLower ( const Value & a , const Value & b , bool CS )
{
return naturalGreater ( b , a , CS ) ;
}
bool ValueCalc : : greater ( const Value & a , const Value & b )