LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/connectivity/source/inc/file - fcomp.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 10 15 66.7 %
Date: 2013-07-09 Functions: 7 10 70.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #ifndef _CONNECTIVITY_FILE_FCOMP_HXX_
      20             : #define _CONNECTIVITY_FILE_FCOMP_HXX_
      21             : 
      22             : #include "file/fcode.hxx"
      23             : #include "file/filedllapi.hxx"
      24             : #ifndef _LIST_
      25             : #include <list>
      26             : #endif
      27             : 
      28             : namespace connectivity
      29             : {
      30             :     class OSQLParseNode;
      31             :     namespace file
      32             :     {
      33             :         class OCode;
      34             :         class OOperand;
      35             :         class OSQLAnalyzer;
      36             :         typedef::std::vector<OCode*> OCodeList;
      37             : 
      38             :         class OPredicateCompiler : public ::salhelper::SimpleReferenceObject
      39             :         {
      40             :             friend class OPredicateInterpreter;
      41             :             friend class OSQLAnalyzer;
      42             : 
      43             :             OCodeList                               m_aCodeList;
      44             :             OFileColumns                            m_orgColumns; // in filecurs this are the filecolumns
      45             :             OSQLAnalyzer*                           m_pAnalyzer;
      46             :             ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xIndexes;
      47             :             sal_Int32                               m_nParamCounter;
      48             :             sal_Bool                                m_bORCondition;
      49             :         public:
      50             :             OPredicateCompiler(OSQLAnalyzer* pAnalyzer);
      51             : 
      52             :             virtual ~OPredicateCompiler();
      53             : 
      54          46 :             inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
      55          46 :                 { return ::rtl_allocateMemory( nSize ); }
      56             :             inline static void * SAL_CALL operator new( size_t /*nSize*/,void* _pHint ) SAL_THROW(())
      57             :                 { return _pHint; }
      58          46 :             inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
      59          46 :                 { ::rtl_freeMemory( pMem ); }
      60             :             inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW(())
      61             :                 {  }
      62             :             void dispose();
      63             : 
      64             :             void start(connectivity::OSQLParseNode* pSQLParseNode);
      65             :             OOperand* execute(connectivity::OSQLParseNode* pPredicateNode);
      66             : 
      67             :             void Clean();
      68        1723 :             sal_Bool isClean() const {return m_aCodeList.empty();}
      69        1723 :             sal_Bool hasCode() const {return !isClean();}
      70           0 :             sal_Bool hasORCondition() const {return m_bORCondition;}
      71          46 :             void     setOrigColumns(const OFileColumns& rCols) { m_orgColumns = rCols; }
      72           0 :             const OFileColumns getOrigColumns() const { return m_orgColumns; }
      73             :         protected:
      74             :             OOperand* execute_COMPARE(connectivity::OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
      75             :             OOperand* execute_LIKE(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
      76             :             OOperand* execute_BETWEEN(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
      77             :             OOperand* execute_ISNULL(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
      78             :             OOperand* execute_Operand(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
      79             :             OOperand* execute_Fold(OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
      80             :             OOperand* executeFunction(OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
      81             :         };
      82             : 
      83             : 
      84             :         class OPredicateInterpreter :
      85             :             public ::salhelper::SimpleReferenceObject
      86             :         {
      87             :             OCodeStack          m_aStack;
      88             :             ::rtl::Reference<OPredicateCompiler> m_rCompiler;
      89             : 
      90             :         public:
      91          46 :             OPredicateInterpreter(const ::rtl::Reference<OPredicateCompiler>& rComp) : m_rCompiler(rComp){}
      92             :             virtual ~OPredicateInterpreter();
      93             : 
      94             :             sal_Bool    evaluate(OCodeList& rCodeList);
      95             :             void        evaluateSelection(OCodeList& rCodeList,ORowSetValueDecoratorRef& _rVal);
      96             : 
      97          18 :             inline sal_Bool start()
      98             :             {
      99          18 :                 return evaluate(m_rCompiler->m_aCodeList);
     100             :             }
     101             : 
     102           0 :             inline void startSelection(ORowSetValueDecoratorRef& _rVal)
     103             :             {
     104           0 :                 evaluateSelection(m_rCompiler->m_aCodeList,_rVal);
     105           0 :             }
     106             : 
     107             : 
     108             :         };
     109             :     }
     110             : }
     111             : #endif // _CONNECTIVITY_FILE_FCOMP_HXX_
     112             : 
     113             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10