LibreOffice Module connectivity (master) 1
FNoException.cxx
Go to the documentation of this file.
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
20#include <file/FCatalog.hxx>
21#include <file/fcomp.hxx>
22#include <file/fanalyzer.hxx>
23#include <file/FResultSet.hxx>
26#include <tools/debug.hxx>
27#include <TKeyValue.hxx>
28
29using namespace connectivity;
30using namespace connectivity::file;
31
32void OFileCatalog::refreshViews()
33{}
35{}
37{
38}
39
41{
42 while(!m_aStack.empty())
43 {
44 delete m_aStack.top();
45 m_aStack.pop();
46 }
47 // m_aStack.clear();
48}
49
51{
52 m_aCodeList.clear();
53}
54
56{
57 OCodeList& rCodeList = m_aCompiler->m_aCodeList;
58 for (auto const& code : rCodeList)
59 {
60 OOperandParam* pParam = dynamic_cast<OOperandParam*>(code.get());
61 if ( pParam )
62 pParam->bindValue(_pRow);
63 }
64}
65
66void OPreparedStatement::scanParameter(OSQLParseNode* pParseNode,std::vector< OSQLParseNode*>& _rParaNodes)
67{
68 DBG_ASSERT(pParseNode != nullptr,"OResultSet: internal error: invalid ParseNode");
69
70 // found parameter Name-Rule?
71 if (SQL_ISRULE(pParseNode,parameter))
72 {
73 DBG_ASSERT(pParseNode->count() >= 1,"OResultSet: faulty Parse Tree");
74 DBG_ASSERT(pParseNode->getChild(0)->getNodeType() == SQLNodeType::Punctuation,"OResultSet: faulty Parse Tree");
75
76 _rParaNodes.push_back(pParseNode);
77 // Further descend not necessary
78 return;
79 }
80
81 // Further descend in Parse Tree
82 for (size_t i = 0; i < pParseNode->count(); i++)
83 scanParameter(pParseNode->getChild(i),_rParaNodes);
84}
85
86std::unique_ptr<OKeyValue> OResultSet::GetOrderbyKeyValue(OValueRefRow const & _rRow)
87{
88 sal_uInt32 nBookmarkValue = std::abs((*_rRow)[0]->getValue().getInt32());
89
90 std::unique_ptr<OKeyValue> pKeyValue = OKeyValue::createKeyValue(nBookmarkValue);
91
92 for (auto const& elem : m_aOrderbyColumnNumber)
93 {
94 OSL_ENSURE(elem < static_cast<sal_Int32>(_rRow->size()),"Invalid index for orderkey values!");
95 pKeyValue->pushKey(new ORowSetValueDecorator((*_rRow)[elem]->getValue()));
96 }
97
98 return pKeyValue;
99}
100
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static std::unique_ptr< OKeyValue > createKeyValue(sal_Int32 nVal)
Definition: TSortIndex.cxx:146
ORowSetValueDecorator decorates an ORowSetValue so the value is "refcounted".
Definition: FValue.hxx:402
OSQLParseNode * getChild(sal_uInt32 nPos) const
Definition: sqlnode.hxx:433
SQLNodeType getNodeType() const
Definition: sqlnode.hxx:339
virtual void refreshUsers() override
virtual void refreshGroups() override
void bindValue(const OValueRefRow &_pRow)
Definition: fcode.cxx:40
void scanParameter(OSQLParseNode *pParseNode, std::vector< OSQLParseNode * > &_rParaNodes)
std::unique_ptr< OKeyValue > GetOrderbyKeyValue(OValueRefRow const &_rRow)
const ORowSetValue & getValue(sal_Int32 columnIndex)
Definition: FResultSet.cxx:189
std::vector< sal_Int32 > m_aOrderbyColumnNumber
Definition: FResultSet.hxx:70
::rtl::Reference< OPredicateCompiler > m_aCompiler
Definition: fanalyzer.hxx:32
void bindParameterRow(OValueRefRow const &_pRow)
binds the row to parameter for the restrictions
#define DBG_ASSERT(sCon, aError)
std::vector< std::unique_ptr< OCode > > OCodeList
Definition: fcomp.hxx:31
int i
sal_Unicode code
#define SQL_ISRULE(pParseNode, eRule)
Definition: sqlnode.hxx:439