19#ifndef INCLUDED_CONNECTIVITY_SQLPARSE_HXX
20#define INCLUDED_CONNECTIVITY_SQLPARSE_HXX
22#include <com/sun/star/uno/Reference.h>
46 class XNumberFormatter;
116 typedef ::std::map< sal_uInt32, OSQLParseNode::Rule >
RuleIDMap;
129 ::std::unique_ptr< OSQLParser_Data >
134 css::uno::Reference< css::beans::XPropertySet >
136 css::uno::Reference< css::util::XNumberFormatter >
140 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
141 css::uno::Reference< css::i18n::XCharacterClassification>
m_xCharClass;
145 OUString stringToDouble(
const OUString& _rValue,sal_Int16 _nScale);
147 bool extractDate(
OSQLParseNode const * pLiteral,
double& _rfValue);
152 OSQLParseNode* buildNode_Date(
const double& fValue, sal_Int32 nType);
159 OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext,
const IParseContext* _pContext =
nullptr);
163 std::unique_ptr<OSQLParseNode>
parseTree(OUString& rErrorMessage,
164 const OUString& rStatement,
165 bool bInternational =
false);
170 std::unique_ptr<OSQLParseNode> predicateTree(OUString& rErrorMessage,
const OUString& rStatement,
171 const css::uno::Reference< css::util::XNumberFormatter > & xFormatter,
172 const css::uno::Reference< css::beans::XPropertySet > & xField,
173 bool bUseRealName =
true);
179 const SQLError& getErrorHelper()
const;
184#if OSL_DEBUG_LEVEL > 0
199 static sal_Int32 getFunctionReturnType(std::u16string_view _sFunctionName,
const IParseContext* pContext);
202 static sal_Int32 getFunctionParameterType(sal_uInt32 _nTokenId,sal_uInt32 _nPos);
211 bool inPredicateCheck()
const {
return m_xField.is();}
212 const OUString&
getFieldName()
const {
return m_sFieldName;}
214 static void reduceLiteral(OSQLParseNode*& pLiteral,
bool bAppendBlank);
216 sal_Int16 buildNode(OSQLParseNode*& pAppend,OSQLParseNode* pCompare,OSQLParseNode* pLiteral,OSQLParseNode* pLiteral2);
218 sal_Int16 buildComparisonRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral);
220 sal_Int16 buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode*
const pLiteral,OSQLParseNode* pCompare,OSQLParseNode* pLiteral2 =
nullptr);
222 sal_Int16 buildLikeRule(OSQLParseNode* pAppend, OSQLParseNode*& pLiteral,
const OSQLParseNode* pEscape);
223 sal_Int16 buildStringNodes(OSQLParseNode*& pLiteral);
virtual css::lang::Locale getPreferredLocale() const override
gets a locale instance which should be used when parsing in the context specified by this instance
virtual InternationalKeyCode getIntlKeyCode(const OString &rToken) const override
virtual OUString getErrorMessage(ErrorCode _eCodes) const override
static const css::lang::Locale & getDefaultLocale()
virtual OString getIntlKeywordAscii(InternationalKeyCode _eKey) const override
special node for avoiding memory leaks
::std::vector< OSQLParseNode * > m_aNodes
OSQLParseNodesContainer()
void push_back(OSQLParseNode *_pNode)
void erase(OSQLParseNode *_pNode)
~OSQLParseNodesContainer()
void error(const char *fmt)
css::uno::Reference< css::uno::XComponentContext > m_xContext
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
css::uno::Reference< css::beans::XPropertySet > m_xField
static OSQLScanner * s_pScanner
static OSQLParseNode::Rule RuleIDToRule(sal_uInt32 _nRule)
static OParseContext s_aDefaultContext
static sal_Int32 s_nRefCount
static OString TokenIDToStr(sal_uInt32 nTokenID, const IParseContext *pContext=nullptr)
static vcl::DeleteOnDeinit< css::uno::Reference< css::i18n::XLocaleData4 > > s_xLocaleData
::std::map< sal_uInt32, OSQLParseNode::Rule > RuleIDMap
static sal_uInt32 StrToRuleID(const OString &rValue)
std::unique_ptr< OSQLParseNode > parseTree(OUString &rErrorMessage, const OUString &rStatement, bool bInternational=false)
css::uno::Reference< css::i18n::XCharacterClassification > m_xCharClass
::std::unique_ptr< OSQLParser_Data > m_pData
static RuleIDMap s_aReverseRuleIDLookup
static OSQLParseNodesGarbageCollector * s_pGarbageCollector
const IParseContext * m_pContext
const IParseContext & getContext() const
std::unique_ptr< OSQLParseNode > m_pParseTree
static OUString RuleIDToStr(sal_uInt32 nRuleID)
static sal_uInt32 RuleID(OSQLParseNode::Rule eRule)
sal_Int32 m_nDateFormatKey
a class which provides helpers for working with SQLErrors
class SAL_NO_VTABLE XPropertySet
OUString getFieldName(guint nCol)
comphelper::SingletonRef< OSQLParseNodesContainer > OSQLParseNodesGarbageCollector
::osl::Mutex & getMutex()
css::lang::Locale aLocale
::connectivity::SQLError aErrors