diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-01-29 15:45:51 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-01-29 15:45:51 +0100 |
commit | 517ad9d4b6eae320b708d03a9340a22893b0cab7 (patch) | |
tree | 37cf1907008821b4155cf90718b8d7b00a9d3461 /src/core/xbfilter.cpp | |
parent | 4875a3dd9b183dcd2256e2abfc4ccf7484c233b4 (diff) |
New upstream version 4.0.3upstream/4.0.3
Diffstat (limited to 'src/core/xbfilter.cpp')
-rwxr-xr-x | src/core/xbfilter.cpp | 111 |
1 files changed, 42 insertions, 69 deletions
diff --git a/src/core/xbfilter.cpp b/src/core/xbfilter.cpp index e75f583..507a9e7 100755 --- a/src/core/xbfilter.cpp +++ b/src/core/xbfilter.cpp @@ -14,7 +14,6 @@ Email Contact: This module handles uda (user data area) methods - */ #include "xbase.h" @@ -75,11 +74,11 @@ xbInt16 xbFilter::Set( xbString &sFilter ) { exp = new xbExp( xbase, dbf ); if(( iRc = exp->ParseExpression( sFilter.Str() )) != XB_NO_ERROR ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } if( exp->GetReturnType() != XB_EXP_LOGICAL ){ - iErrorStop = 20; + iErrorStop = 110; iRc = XB_INVALID_EXPRESSION; delete exp; exp = NULL; @@ -102,21 +101,16 @@ xbInt16 xbFilter::GetFirstRecord( xbInt16 iOption ) { try{ if( !exp ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } - #ifdef XB_INDEX_SUPPORT - if( dbf->GetCurIx() && dbf->GetCurTag() ) - return GetFirstRecordIx( iOption ); - #endif - lCurQryCnt = 0; if(( iRc = dbf->GetFirstRecord( iOption )) != XB_NO_ERROR ){ if( iRc == XB_EMPTY || iRc == XB_EOF ) return iRc; else{ - iErrorStop = 20; + iErrorStop = 110; throw iRc; } } @@ -124,11 +118,11 @@ xbInt16 xbFilter::GetFirstRecord( xbInt16 iOption ) { xbBool bFound = xbFalse; while( !bFound && iRc == XB_NO_ERROR ){ if(( iRc = exp->ProcessExpression()) != XB_NO_ERROR ){ - iErrorStop = 30; + iErrorStop = 120; throw iRc; } if(( iRc = exp->GetBoolResult( bFound )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if( !bFound ){ @@ -136,7 +130,7 @@ xbInt16 xbFilter::GetFirstRecord( xbInt16 iOption ) { if( iRc == XB_EOF ){ return iRc; } else { - iErrorStop = 50; + iErrorStop = 140; throw iRc; } } @@ -160,15 +154,10 @@ xbInt16 xbFilter::GetNextRecord( xbInt16 iOption ){ try{ if( !exp ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } - #ifdef XB_INDEX_SUPPORT - if( dbf->GetCurIx() && dbf->GetCurTag()) - return GetNextRecordIx( iOption ); - #endif - if( lLimit != 0 && abs( lCurQryCnt ) >= lLimit ) return XB_LIMIT_REACHED; @@ -176,7 +165,7 @@ xbInt16 xbFilter::GetNextRecord( xbInt16 iOption ){ if( iRc == XB_EOF ) return iRc; else{ - iErrorStop = 20; + iErrorStop = 110; throw iRc; } } @@ -184,11 +173,11 @@ xbInt16 xbFilter::GetNextRecord( xbInt16 iOption ){ xbBool bFound = xbFalse; while( !bFound && iRc == XB_NO_ERROR ){ if(( iRc = exp->ProcessExpression()) != XB_NO_ERROR ){ - iErrorStop = 30; + iErrorStop = 120; throw iRc; } if(( iRc = exp->GetBoolResult( bFound )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if( !bFound ){ @@ -196,7 +185,7 @@ xbInt16 xbFilter::GetNextRecord( xbInt16 iOption ){ if( iRc == XB_EOF ){ return iRc; } else { - iErrorStop = 50; + iErrorStop = 140; throw iRc; } } @@ -220,16 +209,10 @@ xbInt16 xbFilter::GetPrevRecord( xbInt16 iOption ){ try{ if( !exp ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } - #ifdef XB_INDEX_SUPPORT - //if( pIx && vpTag ) - if( dbf->GetCurIx() && dbf->GetCurTag()) - return GetPrevRecordIx( iOption ); - #endif - if( lLimit != 0 && abs( lCurQryCnt ) >= lLimit ) return XB_LIMIT_REACHED; @@ -237,7 +220,7 @@ xbInt16 xbFilter::GetPrevRecord( xbInt16 iOption ){ if( iRc == XB_BOF ) return iRc; else{ - iErrorStop = 20; + iErrorStop = 110; throw iRc; } } @@ -245,11 +228,11 @@ xbInt16 xbFilter::GetPrevRecord( xbInt16 iOption ){ xbBool bFound = xbFalse; while( !bFound && iRc == XB_NO_ERROR ){ if(( iRc = exp->ProcessExpression()) != XB_NO_ERROR ){ - iErrorStop = 30; + iErrorStop = 120; throw iRc; } if(( iRc = exp->GetBoolResult( bFound )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if( !bFound ){ @@ -257,7 +240,7 @@ xbInt16 xbFilter::GetPrevRecord( xbInt16 iOption ){ if( iRc == XB_BOF ){ return iRc; } else { - iErrorStop = 50; + iErrorStop = 140; throw iRc; } } @@ -281,21 +264,16 @@ xbInt16 xbFilter::GetLastRecord( xbInt16 iOption ){ try{ if( !exp ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } - #ifdef XB_INDEX_SUPPORT - if( dbf->GetCurIx() && dbf->GetCurTag()) - return GetLastRecordIx( iOption ); - #endif - lCurQryCnt = 0; if(( iRc = dbf->GetLastRecord( iOption )) != XB_NO_ERROR ){ if( iRc == XB_EOF ) return iRc; else{ - iErrorStop = 20; + iErrorStop = 110; throw iRc; } } @@ -303,11 +281,11 @@ xbInt16 xbFilter::GetLastRecord( xbInt16 iOption ){ xbBool bFound = xbFalse; while( !bFound && iRc == XB_NO_ERROR ){ if(( iRc = exp->ProcessExpression()) != XB_NO_ERROR ){ - iErrorStop = 30; + iErrorStop = 120; throw iRc; } if(( iRc = exp->GetBoolResult( bFound )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if( !bFound ){ @@ -315,7 +293,7 @@ xbInt16 xbFilter::GetLastRecord( xbInt16 iOption ){ if( iRc == XB_BOF ){ return iRc; } else { - iErrorStop = 50; + iErrorStop = 140; throw iRc; } } @@ -336,11 +314,6 @@ xbInt16 xbFilter::GetLastRecord( xbInt16 iOption ){ #ifdef XB_INDEX_SUPPORT -//void xbFilter::Set( xbIx *pIx, void *vpTag ) { -// this->pIx = pIx; -// this->vpTag = vpTag; -//} - /************************************************************************/ xbInt16 xbFilter::GetFirstRecordIx( xbInt16 iOption ) { @@ -349,7 +322,7 @@ xbInt16 xbFilter::GetFirstRecordIx( xbInt16 iOption ) { try{ if( !exp ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } @@ -358,7 +331,7 @@ xbInt16 xbFilter::GetFirstRecordIx( xbInt16 iOption ) { if( iRc == XB_EMPTY || iRc == XB_EOF ) return iRc; else{ - iErrorStop = 20; + iErrorStop = 110; throw iRc; } } @@ -366,11 +339,11 @@ xbInt16 xbFilter::GetFirstRecordIx( xbInt16 iOption ) { xbBool bFound = xbFalse; while( !bFound && iRc == XB_NO_ERROR ){ if(( iRc = exp->ProcessExpression()) != XB_NO_ERROR ){ - iErrorStop = 30; + iErrorStop = 120; throw iRc; } if(( iRc = exp->GetBoolResult( bFound )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if( !bFound ){ @@ -379,7 +352,7 @@ xbInt16 xbFilter::GetFirstRecordIx( xbInt16 iOption ) { if( iRc == XB_EOF ){ return iRc; } else { - iErrorStop = 50; + iErrorStop = 140; throw iRc; } } @@ -403,7 +376,7 @@ xbInt16 xbFilter::GetNextRecordIx( xbInt16 iOption ){ try{ if( !exp ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } @@ -414,7 +387,7 @@ xbInt16 xbFilter::GetNextRecordIx( xbInt16 iOption ){ if( iRc == XB_EOF ) return iRc; else{ - iErrorStop = 20; + iErrorStop = 110; throw iRc; } } @@ -422,11 +395,11 @@ xbInt16 xbFilter::GetNextRecordIx( xbInt16 iOption ){ xbBool bFound = xbFalse; while( !bFound && iRc == XB_NO_ERROR ){ if(( iRc = exp->ProcessExpression()) != XB_NO_ERROR ){ - iErrorStop = 30; + iErrorStop = 120; throw iRc; } if(( iRc = exp->GetBoolResult( bFound )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if( !bFound ){ @@ -435,7 +408,7 @@ xbInt16 xbFilter::GetNextRecordIx( xbInt16 iOption ){ if( iRc == XB_EOF ){ return iRc; } else { - iErrorStop = 50; + iErrorStop = 140; throw iRc; } } @@ -459,7 +432,7 @@ xbInt16 xbFilter::GetPrevRecordIx( xbInt16 iOption ){ try{ if( !exp ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } @@ -470,7 +443,7 @@ xbInt16 xbFilter::GetPrevRecordIx( xbInt16 iOption ){ if( iRc == XB_BOF ) return iRc; else{ - iErrorStop = 20; + iErrorStop = 110; throw iRc; } } @@ -478,11 +451,11 @@ xbInt16 xbFilter::GetPrevRecordIx( xbInt16 iOption ){ xbBool bFound = xbFalse; while( !bFound && iRc == XB_NO_ERROR ){ if(( iRc = exp->ProcessExpression()) != XB_NO_ERROR ){ - iErrorStop = 30; + iErrorStop = 120; throw iRc; } if(( iRc = exp->GetBoolResult( bFound )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if( !bFound ){ @@ -491,7 +464,7 @@ xbInt16 xbFilter::GetPrevRecordIx( xbInt16 iOption ){ if( iRc == XB_BOF ){ return iRc; } else { - iErrorStop = 50; + iErrorStop = 140; throw iRc; } } @@ -515,7 +488,7 @@ xbInt16 xbFilter::GetLastRecordIx( xbInt16 iOption ){ try{ if( !exp ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } @@ -524,7 +497,7 @@ xbInt16 xbFilter::GetLastRecordIx( xbInt16 iOption ){ if( iRc == XB_EOF ) return iRc; else{ - iErrorStop = 20; + iErrorStop = 110; throw iRc; } } @@ -532,11 +505,11 @@ xbInt16 xbFilter::GetLastRecordIx( xbInt16 iOption ){ xbBool bFound = xbFalse; while( !bFound && iRc == XB_NO_ERROR ){ if(( iRc = exp->ProcessExpression()) != XB_NO_ERROR ){ - iErrorStop = 30; + iErrorStop = 120; throw iRc; } if(( iRc = exp->GetBoolResult( bFound )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if( !bFound ){ @@ -544,7 +517,7 @@ xbInt16 xbFilter::GetLastRecordIx( xbInt16 iOption ){ if( iRc == XB_BOF ){ return iRc; } else { - iErrorStop = 50; + iErrorStop = 140; throw iRc; } } |