virtual void ProcessBinaryLogicalOperator(FdoBinaryLogicalOperator& filter) { if( filter.GetOperation() != FdoBinaryLogicalOperations_Or ) { m_isFragmented = false; return; } HandleFilter( FdoPtr<FdoFilter>(filter.GetRightOperand()) ); m_newFilter = filter.GetLeftOperand(); m_OrCount++; }
void UnitTestProcessor::ProcessBinaryLogicalOperator(FdoBinaryLogicalOperator& filter) { m_tabLevel++; FdoFilter* pFilter = filter.GetLeftOperand(); pFilter->Process(this); pFilter->Release(); m_tabLevel--; prependTabs(); wprintf(L"BinaryLogicalOperator : %d\n", filter.GetOperation()); m_tabLevel++; pFilter = filter.GetRightOperand(); pFilter->Process(this); pFilter->Release(); m_tabLevel--; }
// Converts the filter expression to it's well defined text representation. FdoString* FdoBinaryLogicalOperator::ToStringInternal( FdoIdentifierCollection *pIdCol ) { FdoStringUtility::ClearString(m_toString); FdoFilter* pRight = GetRightOperand(); FdoFilter* pLeft = GetLeftOperand(); if (pRight == NULL || pLeft == NULL) { FDO_SAFE_RELEASE(pRight); FDO_SAFE_RELEASE(pLeft); FdoFilterException* pExcept = FdoFilterException::Create(FdoException::NLSGetMessage(FDO_NLSID(FILTER_1_INCOMPLETEBINARYOPERATOR))); throw pExcept; } bool bParenRight = false; bool bParenLeft = false; FdoString* pszRight = NULL; FdoString* pszLeft = NULL; try { pszRight = pRight->ToStringInternal( pIdCol ); pszLeft = pLeft->ToStringInternal( pIdCol ); } catch (FdoException* pExcept) { FDO_SAFE_RELEASE(pRight); FDO_SAFE_RELEASE(pLeft); throw pExcept; } if (GetOperation() == FdoBinaryLogicalOperations_And) { FdoBinaryLogicalOperator* pBLO = dynamic_cast<FdoBinaryLogicalOperator*>(pRight); if (pBLO != NULL && pBLO->GetOperation() == FdoBinaryLogicalOperations_Or) { bParenRight = true; pszRight = FdoStringUtility::MakeString(L"(", pszRight, L")"); } pBLO = dynamic_cast<FdoBinaryLogicalOperator*>(pLeft); if (pBLO != NULL && pBLO->GetOperation() == FdoBinaryLogicalOperations_Or) { bParenLeft = true; pszLeft = FdoStringUtility::MakeString(L"(", pszLeft, L")"); } } const wchar_t* szOp; switch (GetOperation()) { default: case FdoBinaryLogicalOperations_And: szOp = L" AND "; break; case FdoBinaryLogicalOperations_Or: szOp = L" OR "; break; } m_toString = FdoStringUtility::MakeString(pszLeft, szOp, pszRight); if (bParenLeft) delete [] pszLeft; if (bParenRight) delete [] pszRight; pLeft->Release(); pRight->Release(); return m_toString; }