diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-25 12:28:07 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-25 13:50:26 +0200 |
commit | 960d4ebf76d3e7c757d2625a1e52a22556da9d40 (patch) | |
tree | bdf4a9368addb03388969d626df92934583d4952 /connectivity/source/drivers/file | |
parent | aa0a20bdccda8576163d763a81a0d7135114c17d (diff) |
convert SQLNodeType to scoped enum
Change-Id: I622e55622d38e6017993c8bc52625c85d0f74d74
Diffstat (limited to 'connectivity/source/drivers/file')
-rw-r--r-- | connectivity/source/drivers/file/FNoException.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FStatement.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fanalyzer.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fcode.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fcomp.cxx | 38 |
5 files changed, 28 insertions, 28 deletions
diff --git a/connectivity/source/drivers/file/FNoException.cxx b/connectivity/source/drivers/file/FNoException.cxx index e60b24c3a0d5..ed6fbc911af0 100644 --- a/connectivity/source/drivers/file/FNoException.cxx +++ b/connectivity/source/drivers/file/FNoException.cxx @@ -75,7 +75,7 @@ void OPreparedStatement::scanParameter(OSQLParseNode* pParseNode,::std::vector< if (SQL_ISRULE(pParseNode,parameter)) { DBG_ASSERT(pParseNode->count() >= 1,"OResultSet: Parse Tree fehlerhaft"); - DBG_ASSERT(pParseNode->getChild(0)->getNodeType() == SQL_NODE_PUNCTUATION,"OResultSet: Parse Tree fehlerhaft"); + DBG_ASSERT(pParseNode->getChild(0)->getNodeType() == SQLNodeType::Punctuation,"OResultSet: Parse Tree fehlerhaft"); _rParaNodes.push_back(pParseNode); // Further descend not necessary diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index 1f43f59b9354..f61c06e33875 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -625,7 +625,7 @@ void OStatement_Base::GetAssignValues() OSQLParseNode * pComp = pAssignment->getChild(1); OSL_ENSURE(pComp != nullptr,"OResultSet: pComp == NULL"); - OSL_ENSURE(pComp->getNodeType() == SQL_NODE_EQUAL,"OResultSet: pComp->getNodeType() != SQL_NODE_COMPARISON"); + OSL_ENSURE(pComp->getNodeType() == SQLNodeType::Equal,"OResultSet: pComp->getNodeType() != SQLNodeType::Comparison"); if (pComp->getTokenValue().toChar() != '=') { throwFunctionSequenceException(*this); @@ -647,9 +647,9 @@ void OStatement_Base::ParseAssignValues(const ::std::vector< OUString>& aColumnN OSL_ENSURE(aColumnName.getLength() > 0,"OResultSet: Column-Name nicht gefunden"); OSL_ENSURE(pRow_Value_Constructor_Elem != nullptr,"OResultSet: pRow_Value_Constructor_Elem darf nicht NULL sein!"); - if (pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_STRING || - pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_INTNUM || - pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_APPROXNUM) + if (pRow_Value_Constructor_Elem->getNodeType() == SQLNodeType::String || + pRow_Value_Constructor_Elem->getNodeType() == SQLNodeType::IntNum || + pRow_Value_Constructor_Elem->getNodeType() == SQLNodeType::ApproxNum) { // set value: SetAssignValue(aColumnName, pRow_Value_Constructor_Elem->getTokenValue()); diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx index fe134b1803ec..151f70b8dc8b 100644 --- a/connectivity/source/drivers/file/fanalyzer.cxx +++ b/connectivity/source/drivers/file/fanalyzer.cxx @@ -93,7 +93,7 @@ void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode) if ( SQL_ISPUNCTUATION( pColumnRef, "*" ) || ( SQL_ISRULE( pColumnRef, column_ref ) && ( pColumnRef->count() == 3 ) - && ( pColumnRef->getChild(0)->getNodeType() == SQL_NODE_NAME ) + && ( pColumnRef->getChild(0)->getNodeType() == SQLNodeType::Name ) && SQL_ISPUNCTUATION( pColumnRef->getChild(1), "." ) && SQL_ISRULE( pColumnRef->getChild(2), column_val ) && SQL_ISPUNCTUATION( pColumnRef->getChild(2)->getChild(0), "*" ) diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx index df70e20f9e79..071ff80be9af 100644 --- a/connectivity/source/drivers/file/fcode.cxx +++ b/connectivity/source/drivers/file/fcode.cxx @@ -112,13 +112,13 @@ OOperandConst::OOperandConst(const OSQLParseNode& rColumnRef, const OUString& aS { switch (rColumnRef.getNodeType()) { - case SQL_NODE_STRING: + case SQLNodeType::String: m_aValue = aStrValue; m_eDBType = DataType::VARCHAR; m_aValue.setBound(true); return; - case SQL_NODE_INTNUM: - case SQL_NODE_APPROXNUM: + case SQLNodeType::IntNum: + case SQLNodeType::ApproxNum: m_aValue = aStrValue.toDouble(); m_eDBType = DataType::DOUBLE; m_aValue.setBound(true); diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index 182c55032b71..4133b4ca2d74 100644 --- a/connectivity/source/drivers/file/fcomp.cxx +++ b/connectivity/source/drivers/file/fcomp.cxx @@ -226,9 +226,9 @@ OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) th DBG_ASSERT(pPredicateNode->count() == 3,"OFILECursor: Fehler im Parse Tree"); if ( !(SQL_ISRULE(pPredicateNode->getChild(0),column_ref) || - pPredicateNode->getChild(2)->getNodeType() == SQL_NODE_STRING || - pPredicateNode->getChild(2)->getNodeType() == SQL_NODE_INTNUM || - pPredicateNode->getChild(2)->getNodeType() == SQL_NODE_APPROXNUM || + pPredicateNode->getChild(2)->getNodeType() == SQLNodeType::String || + pPredicateNode->getChild(2)->getNodeType() == SQLNodeType::IntNum || + pPredicateNode->getChild(2)->getNodeType() == SQLNodeType::ApproxNum || SQL_ISTOKEN(pPredicateNode->getChild(2),TRUE) || SQL_ISTOKEN(pPredicateNode->getChild(2),FALSE) || SQL_ISRULE(pPredicateNode->getChild(2),parameter) || @@ -246,17 +246,17 @@ OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) th sal_Int32 ePredicateType( SQLFilterOperator::EQUAL ); OSQLParseNode *pPrec = pPredicateNode->getChild(1); - if (pPrec->getNodeType() == SQL_NODE_EQUAL) + if (pPrec->getNodeType() == SQLNodeType::Equal) ePredicateType = SQLFilterOperator::EQUAL; - else if (pPrec->getNodeType() == SQL_NODE_NOTEQUAL) + else if (pPrec->getNodeType() == SQLNodeType::NotEqual) ePredicateType = SQLFilterOperator::NOT_EQUAL; - else if (pPrec->getNodeType() == SQL_NODE_LESS) + else if (pPrec->getNodeType() == SQLNodeType::Less) ePredicateType = SQLFilterOperator::LESS; - else if (pPrec->getNodeType() == SQL_NODE_LESSEQ) + else if (pPrec->getNodeType() == SQLNodeType::LessEq) ePredicateType = SQLFilterOperator::LESS_EQUAL; - else if (pPrec->getNodeType() == SQL_NODE_GREATEQ) + else if (pPrec->getNodeType() == SQLNodeType::GreatEq) ePredicateType = SQLFilterOperator::GREATER_EQUAL; - else if (pPrec->getNodeType() == SQL_NODE_GREAT) + else if (pPrec->getNodeType() == SQLNodeType::Great) ePredicateType = SQLFilterOperator::GREATER; else OSL_FAIL( "OPredicateCompiler::execute_COMPARE: unexpected node type!" ); @@ -280,7 +280,7 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw( OSQLParseNode* pAtom = pPart2->getChild(pPart2->count()-2); OSQLParseNode* pOptEscape = pPart2->getChild(pPart2->count()-1); - if (!(pAtom->getNodeType() == SQL_NODE_STRING || + if (!(pAtom->getNodeType() == SQLNodeType::String || SQL_ISRULE(pAtom,parameter) || // odbc date SQL_ISRULE(pAtom,set_fct_spec) || @@ -300,7 +300,7 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw( m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_STRING,nullptr); } OSQLParseNode *pEscNode = pOptEscape->getChild(1); - if (pEscNode->getNodeType() != SQL_NODE_STRING) + if (pEscNode->getNodeType() != SQLNodeType::String) { m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_STRING,nullptr); } @@ -329,8 +329,8 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr OSQLParseNode* p2ndtValue = pPart2->getChild(4); if ( - !(p1stValue->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(p1stValue,parameter)) - && !(p2ndtValue->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(p2ndtValue,parameter)) + !(p1stValue->getNodeType() == SQLNodeType::String || SQL_ISRULE(p1stValue,parameter)) + && !(p2ndtValue->getNodeType() == SQLNodeType::String || SQL_ISRULE(p2ndtValue,parameter)) ) { m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_BETWEEN,nullptr); @@ -470,10 +470,10 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) thr { pOperand = new OOperandParam(pPredicateNode, ++m_nParamCounter); } - else if (pPredicateNode->getNodeType() == SQL_NODE_STRING || - pPredicateNode->getNodeType() == SQL_NODE_INTNUM || - pPredicateNode->getNodeType() == SQL_NODE_APPROXNUM || - pPredicateNode->getNodeType() == SQL_NODE_NAME || + else if (pPredicateNode->getNodeType() == SQLNodeType::String || + pPredicateNode->getNodeType() == SQLNodeType::IntNum || + pPredicateNode->getNodeType() == SQLNodeType::ApproxNum || + pPredicateNode->getNodeType() == SQLNodeType::Name || SQL_ISTOKEN(pPredicateNode,TRUE) || SQL_ISTOKEN(pPredicateNode,FALSE) || SQL_ISRULE(pPredicateNode,parameter)) @@ -482,7 +482,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) thr } else if((pPredicateNode->count() == 2) && (SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"+") || SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"-")) && - pPredicateNode->getChild(1)->getNodeType() == SQL_NODE_INTNUM) + pPredicateNode->getChild(1)->getNodeType() == SQLNodeType::IntNum) { // if -1 or +1 is there OUString aValue(pPredicateNode->getChild(0)->getTokenValue()); aValue += pPredicateNode->getChild(1)->getTokenValue(); @@ -494,7 +494,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) thr const OSQLParseNode* pODBCNodeChild = pODBCNode->getChild(0); // Odbc Date or time - if (pODBCNodeChild->getNodeType() == SQL_NODE_KEYWORD && ( + if (pODBCNodeChild->getNodeType() == SQLNodeType::Keyword && ( SQL_ISTOKEN(pODBCNodeChild,D) || SQL_ISTOKEN(pODBCNodeChild,T) || SQL_ISTOKEN(pODBCNodeChild,TS) )) |