1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CONNECTIVITY_SQLSCAN_HXX
20 #define INCLUDED_CONNECTIVITY_SQLSCAN_HXX
23 #include <connectivity/IParseContext.hxx>
24 #include <connectivity/dbtoolsdllapi.hxx>
26 namespace connectivity
33 class OOO_DLLPUBLIC_DBTOOLS OSQLScanner
35 const IParseContext
* m_pContext
; // context for parse, knows all international stuff
36 OString m_sStatement
; // statement to parse
37 OUString m_sErrorMessage
;
39 sal_Int32 m_nCurrentPos
; // next position to read from the statement
40 bool m_bInternational
; // do we have a statement which may uses
41 sal_Int32 m_nRule
; // rule to be set
45 virtual ~OSQLScanner();
47 inline static void * SAL_CALL
operator new( size_t nSize
)
48 { return ::rtl_allocateMemory( nSize
); }
49 inline static void * SAL_CALL
operator new( size_t,void* _pHint
)
51 inline static void SAL_CALL
operator delete( void * pMem
)
52 { ::rtl_freeMemory( pMem
); }
53 inline static void SAL_CALL
operator delete( void *,void* )
56 sal_Int32
SQLyygetc();
57 void SQLyyerror(char const *fmt
);
58 static void output(sal_Int32
) { OSL_FAIL("Internal error in sdblex.l: output not possible"); }
59 static void ECHO() { OSL_FAIL("Internal error in sdblex.l: ECHO not possible"); }
60 IParseContext::InternationalKeyCode
getInternationalTokenID(const char* sToken
) const;
62 // setting the new information before scanning
63 void prepareScan(const OUString
& rNewStatement
, const IParseContext
* pContext
, bool bInternational
);
64 const OUString
& getErrorMessage() const {return m_sErrorMessage
;}
65 OString
getStatement() const { return m_sStatement
; }
68 // set this as scanner for flex
69 void setScanner(bool _bNull
=false);
71 void SetRule(sal_Int32 nRule
) {m_nRule
= nRule
;}
72 sal_Int32
GetGERRule() const;
73 sal_Int32
GetENGRule() const;
74 sal_Int32
GetSQLRule() const;
75 sal_Int32
GetDATERule() const;
76 sal_Int32
GetSTRINGRule() const;
77 inline sal_Int32
GetCurrentPos() const { return m_nCurrentPos
; }
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */