1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_connectivity.hxx" 26 #include <connectivity/virtualdbtools.hxx> 27 #include "parser_s.hxx" 28 #include "parsenode_s.hxx" 29 30 using namespace ::com::sun::star::uno; 31 using namespace ::com::sun::star::util; 32 using namespace ::com::sun::star::beans; 33 using namespace ::com::sun::star::lang; 34 35 //........................................................................ 36 namespace connectivity 37 { 38 //........................................................................ 39 40 //================================================================ 41 //= OSimpleSQLParser 42 //================================================================ 43 //---------------------------------------------------------------- OSimpleSQLParser(const Reference<XMultiServiceFactory> & _rxServiceFactory,const IParseContext * _pContext)44 OSimpleSQLParser::OSimpleSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext) 45 :m_aFullParser(_rxServiceFactory,_pContext) 46 { 47 } 48 49 //---------------------------------------------------------------- acquire()50 oslInterlockedCount SAL_CALL OSimpleSQLParser::acquire() 51 { 52 return ORefBase::acquire(); 53 } 54 55 //---------------------------------------------------------------- release()56 oslInterlockedCount SAL_CALL OSimpleSQLParser::release() 57 { 58 return ORefBase::release(); 59 } 60 61 //---------------------------------------------------------------- getContext() const62 const IParseContext& OSimpleSQLParser::getContext() const 63 { 64 return m_aFullParser.getContext(); 65 } 66 67 //---------------------------------------------------------------- predicateTree(::rtl::OUString & rErrorMessage,const::rtl::OUString & rStatement,const Reference<XNumberFormatter> & _rxFormatter,const Reference<XPropertySet> & _rxField) const68 ::rtl::Reference< simple::ISQLParseNode > OSimpleSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const ::rtl::OUString& rStatement, 69 const Reference< XNumberFormatter >& _rxFormatter, const Reference< XPropertySet >& _rxField) const 70 { 71 OSimpleParseNode* pReturn = NULL; 72 OSQLParseNode* pFullNode = const_cast<OSimpleSQLParser*>(this)->m_aFullParser.predicateTree(rErrorMessage, rStatement, _rxFormatter, _rxField); 73 if (pFullNode) 74 pReturn = new OSimpleParseNode(pFullNode, sal_True); 75 return pReturn; 76 } 77 78 //........................................................................ 79 } // namespace connectivity 80 //........................................................................ 81 82 83