LibreOffice Module connectivity (master) 1
DIndex.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 <dbase/DIndex.hxx>
22#include <dbase/DTable.hxx>
23#include <dbase/DIndexIter.hxx>
24#include <osl/file.hxx>
25#include <sal/log.hxx>
26#include <tools/config.hxx>
28#include <com/sun/star/sdbc/XResultSet.hpp>
29#include <com/sun/star/sdbc/XRow.hpp>
32#include <comphelper/types.hxx>
34#include <dbase/DResultSet.hxx>
35#include <strings.hrc>
37
38using namespace ::comphelper;
39
40using namespace connectivity;
41using namespace utl;
42using namespace ::cppu;
43using namespace connectivity::file;
44using namespace connectivity::sdbcx;
45using namespace connectivity::dbase;
46using namespace com::sun::star::sdbc;
47using namespace com::sun::star::sdbcx;
48using namespace com::sun::star::uno;
49using namespace com::sun::star::beans;
50using namespace com::sun::star::lang;
51
52IMPLEMENT_SERVICE_INFO(ODbaseIndex,"com.sun.star.sdbcx.driver.dbase.Index","com.sun.star.sdbcx.Index");
53
54ODbaseIndex::ODbaseIndex(ODbaseTable* _pTable)
55 : OIndex(true/*_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers()*/)
56 , m_nCurNode(NODE_NOTFOUND)
57 , m_nPageCount(0)
58 , m_nRootPage(0)
59 , m_pTable(_pTable)
60 , m_bUseCollector(false)
61{
62 construct();
63}
64
66 const NDXHeader& _rHeader,
67 const OUString& _rName)
68 : OIndex(_rName, OUString(), _rHeader.db_unique, false, false, true)
69 , m_aHeader(_rHeader)
70 , m_nCurNode(NODE_NOTFOUND)
71 , m_nPageCount(0)
72 , m_nRootPage(0)
73 , m_pTable(_pTable)
74 , m_bUseCollector(false)
75{
76 construct();
77}
78
80{
81 closeImpl();
82}
83
85{
86 ::osl::MutexGuard aGuard( m_aMutex );
87
88 ::std::vector< OUString> aVector;
89 if(!isNew())
90 {
91 OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
92 OSL_ENSURE(m_aHeader.db_name[0] != '\0',"Invalid name for the column!");
93 aVector.push_back(OUString::createFromAscii(m_aHeader.db_name));
94 }
95
96 if(m_pColumns)
97 m_pColumns->reFill(aVector);
98 else
99 m_pColumns.reset(new ODbaseIndexColumns(this,m_aMutex,aVector));
100}
101
103{
105 if (!m_aRoot.Is())
106 {
109 m_aRoot = CreatePage(m_nRootPage,nullptr,true);
110 }
111 return m_aRoot;
112}
113
115{
116 if(m_pFileStream)
117 return;
118
119 OUString sFile = getCompletePath();
120 if(UCBContentHelper::Exists(sFile))
121 {
122 m_pFileStream = OFileTable::createStream_simpleError(sFile, StreamMode::READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE);
123 if (!m_pFileStream)
124 m_pFileStream = OFileTable::createStream_simpleError(sFile, StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYNONE);
125 if(m_pFileStream)
126 {
127 m_pFileStream->SetEndian(SvStreamEndian::LITTLE);
128 m_pFileStream->SetBufferSize(DINDEX_PAGE_SIZE);
129 (*m_pFileStream) >> *this;
130 }
131 }
132 if(!m_pFileStream)
133 {
135 STR_COULD_NOT_LOAD_FILE,
136 "$filename$", sFile
137 ) );
139 }
140}
141
142std::unique_ptr<OIndexIterator> ODbaseIndex::createIterator()
143{
145 return std::make_unique<OIndexIterator>(this);
146}
147
148bool ODbaseIndex::ConvertToKey(ONDXKey* rKey, sal_uInt32 nRec, const ORowSetValue& rValue)
149{
150 OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
151 // Search a specific value in Index
152 // If the Index is unique, the key doesn't matter
153 try
154 {
155 if (m_aHeader.db_keytype == 0)
156 {
157 *rKey = ONDXKey(rValue.getString(), nRec );
158 }
159 else
160 {
161 if (rValue.isNull())
162 *rKey = ONDXKey(rValue.getDouble(), DataType::DOUBLE, nRec );
163 else
164 *rKey = ONDXKey(rValue.getDouble(), nRec );
165 }
166 }
167 catch (Exception&)
168 {
169 OSL_ASSERT(false);
170 return false;
171 }
172 return true;
173}
174
175
176bool ODbaseIndex::Find(sal_uInt32 nRec, const ORowSetValue& rValue)
177{
179 OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
180 // Search a specific value in Index
181 // If the Index is unique, the key doesn't matter
182 ONDXKey aKey;
183 return ConvertToKey(&aKey, nRec, rValue) && getRoot()->Find(aKey);
184}
185
186
187bool ODbaseIndex::Insert(sal_uInt32 nRec, const ORowSetValue& rValue)
188{
190 OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
191 ONDXKey aKey;
192
193 // Does the value already exist
194 // Use Find() always to determine the actual leaf
195 if (!ConvertToKey(&aKey, nRec, rValue) || (getRoot()->Find(aKey) && isUnique()))
196 return false;
197
198 ONDXNode aNewNode(aKey);
199
200 // insert in the current leaf
201 if (!m_aCurLeaf.Is())
202 return false;
203
204 bool bResult = m_aCurLeaf->Insert(aNewNode);
205 Release(bResult);
206
207 return bResult;
208}
209
210
211bool ODbaseIndex::Update(sal_uInt32 nRec, const ORowSetValue& rOldValue,
212 const ORowSetValue& rNewValue)
213{
215 OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
216 ONDXKey aKey;
217 if (!ConvertToKey(&aKey, nRec, rNewValue) || (isUnique() && getRoot()->Find(aKey)))
218 return false;
219 else
220 return Delete(nRec, rOldValue) && Insert(nRec,rNewValue);
221}
222
223
224bool ODbaseIndex::Delete(sal_uInt32 nRec, const ORowSetValue& rValue)
225{
227 OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
228 // Does the value already exist
229 // Always use Find() to determine the actual leaf
230 ONDXKey aKey;
231 if (!ConvertToKey(&aKey, nRec, rValue) || !getRoot()->Find(aKey))
232 return false;
233
234 // insert in the current leaf
235 if (!m_aCurLeaf.Is())
236 return false;
237#if OSL_DEBUG_LEVEL > 1
239#endif
240
242 return true;
243}
244
246{
247 if (pPage)
248 m_aCollector.push_back(pPage);
249}
250
251void ODbaseIndex::Release(bool bSave)
252{
253 // Release the Index-resources
254 m_bUseCollector = false;
255
256 if (m_aCurLeaf.Is())
257 {
258 m_aCurLeaf->Release(bSave);
260 }
261
262 // Release the root
263 if (m_aRoot.Is())
264 {
265 m_aRoot->Release(bSave);
266 m_aRoot.Clear();
267 }
268 // Release all references, before the FileStream will be closed
269 for (auto& i : m_aCollector)
270 i->QueryDelete();
271
272 m_aCollector.clear();
273
274 // Header modified?
275 if (bSave && (m_aHeader.db_rootpage != m_nRootPage ||
277 {
281 }
284
285 closeImpl();
286}
287
289{
290 m_pFileStream.reset();
291}
292
293ONDXPage* ODbaseIndex::CreatePage(sal_uInt32 nPagePos, ONDXPage* pParent, bool bLoad)
294{
295 OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
296
297 ONDXPage* pPage;
298 if ( !m_aCollector.empty() )
299 {
300 pPage = *(m_aCollector.rbegin());
301 m_aCollector.pop_back();
302 pPage->SetPagePos(nPagePos);
303 pPage->SetParent(pParent);
304 }
305 else
306 pPage = new ONDXPage(*this, nPagePos, pParent);
307
308 if (bLoad)
309 (*m_pFileStream) >> *pPage;
310
311 return pPage;
312}
313
315 SvStream & rStream, ODbaseIndex::NDXHeader & rHeader)
316{
317#if !defined(NDEBUG)
318 sal_uInt64 const nOldPos(rStream.Tell());
319#endif
320 rStream.ReadUInt32(rHeader.db_rootpage);
321 rStream.ReadUInt32(rHeader.db_pagecount);
322 rStream.ReadBytes(&rHeader.db_free, 4);
323 rStream.ReadUInt16(rHeader.db_keylen);
324 rStream.ReadUInt16(rHeader.db_maxkeys);
325 rStream.ReadUInt16(rHeader.db_keytype);
326 rStream.ReadUInt16(rHeader.db_keyrec);
327 rStream.ReadBytes(&rHeader.db_free1, 3);
328 rStream.ReadUChar(rHeader.db_unique);
329 rStream.ReadBytes(&rHeader.db_name, 488);
330 assert(rStream.GetError() || rStream.Tell() == nOldPos + DINDEX_PAGE_SIZE);
331}
332
334{
335 rStream.Seek(0);
336 ReadHeader(rStream, rIndex.m_aHeader);
337
338 rIndex.m_nRootPage = rIndex.m_aHeader.db_rootpage;
339 rIndex.m_nPageCount = rIndex.m_aHeader.db_pagecount;
340 return rStream;
341}
342
344{
345 rStream.Seek(0);
346 rStream.WriteUInt32(rIndex.m_aHeader.db_rootpage);
347 rStream.WriteUInt32(rIndex.m_aHeader.db_pagecount);
348 rStream.WriteBytes(&rIndex.m_aHeader.db_free, 4);
349 rStream.WriteUInt16(rIndex.m_aHeader.db_keylen);
350 rStream.WriteUInt16(rIndex.m_aHeader.db_maxkeys);
351 rStream.WriteUInt16(rIndex.m_aHeader.db_keytype);
352 rStream.WriteUInt16(rIndex.m_aHeader.db_keyrec);
353 rStream.WriteBytes(&rIndex.m_aHeader.db_free1, 3);
354 rStream.WriteUChar(rIndex.m_aHeader.db_unique);
355 rStream.WriteBytes(&rIndex.m_aHeader.db_name, 488);
356 assert(rStream.GetError() || rStream.Tell() == DINDEX_PAGE_SIZE);
357 SAL_WARN_IF(rStream.GetError(), "connectivity.dbase", "write error");
358 return rStream;
359}
360
362{
363 OUString sDir = m_pTable->getConnection()->getURL() +
365 m_Name + ".ndx";
366 return sDir;
367}
368
370{
371 // synchronize inf-file
372 const OUString sEntry(m_Name + ".ndx");
373
374 OUString sCfgFile(m_pTable->getConnection()->getURL() +
376 m_pTable->getName() +
377 ".inf");
378
379 OUString sPhysicalPath;
380 osl::FileBase::getSystemPathFromFileURL(sCfgFile, sPhysicalPath);
381
382 Config aInfFile(sPhysicalPath);
383 aInfFile.SetGroup(dBASE_III_GROUP);
384
385 sal_uInt16 nSuffix = aInfFile.GetKeyCount();
386 OString aNewEntry,aKeyName;
387 bool bCase = isCaseSensitive();
388 while (aNewEntry.isEmpty())
389 {
390 aNewEntry = "NDX" + OString::number(++nSuffix);
391 for (sal_uInt16 i = 0; i < aInfFile.GetKeyCount(); i++)
392 {
393 aKeyName = aInfFile.GetKeyName(i);
394 if (bCase ? aKeyName == aNewEntry : aKeyName.equalsIgnoreAsciiCase(aNewEntry))
395 {
396 aNewEntry.clear();
397 break;
398 }
399 }
400 }
401 aInfFile.WriteKey(aNewEntry, OUStringToOString(sEntry, m_pTable->getConnection()->getTextEncoding()));
402}
403
405{
406 closeImpl();
407
408 OUString sPath = getCompletePath();
409 if(UCBContentHelper::Exists(sPath))
410 {
411 if(!UCBContentHelper::Kill(sPath))
412 m_pTable->getConnection()->throwGenericSQLException(STR_COULD_NOT_DELETE_INDEX,*m_pTable);
413 }
414
415 // synchronize inf-file
416 OUString sCfgFile = m_pTable->getConnection()->getURL() +
418 m_pTable->getName() + ".inf";
419
420 OUString sPhysicalPath;
421 OSL_VERIFY( osl::FileBase::getSystemPathFromFileURL(sCfgFile, sPhysicalPath)
422 == osl::FileBase::E_None );
423
424 Config aInfFile(sPhysicalPath);
425 aInfFile.SetGroup(dBASE_III_GROUP);
426 sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
427 OString aKeyName;
428 OUString sEntry = m_Name + ".ndx";
429
430 // delete entries from the inf file
431 for (sal_uInt16 nKey = 0; nKey < nKeyCnt; nKey++)
432 {
433 // References the Key to an Index-file?
434 aKeyName = aInfFile.GetKeyName( nKey );
435 if (aKeyName.startsWith("NDX"))
436 {
437 if(sEntry == OStringToOUString(aInfFile.ReadKey(aKeyName),m_pTable->getConnection()->getTextEncoding()))
438 {
439 aInfFile.DeleteKey(aKeyName);
440 break;
441 }
442 }
443 }
444}
445
446void ODbaseIndex::impl_killFileAndthrowError_throw(TranslateId pErrorId, const OUString& _sFile)
447{
448 closeImpl();
449 if(UCBContentHelper::Exists(_sFile))
450 UCBContentHelper::Kill(_sFile);
452}
453
455{
456 // Create the Index
457 const OUString sFile = getCompletePath();
458 if(UCBContentHelper::Exists(sFile))
459 {
461 STR_COULD_NOT_CREATE_INDEX_NAME,
462 "$filename$", sFile
463 ) );
465 }
466 // Index comprises only one column
467 if (m_pColumns->getCount() > 1)
468 m_pTable->getConnection()->throwGenericSQLException(STR_ONL_ONE_COLUMN_PER_INDEX,*this);
469
470 Reference<XFastPropertySet> xCol(m_pColumns->getByIndex(0),UNO_QUERY);
471
472 // Is the column already indexed?
473 if ( !xCol.is() )
475
476 // create the index file
477 m_pFileStream = OFileTable::createStream_simpleError(sFile,StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC);
478 if (!m_pFileStream)
479 {
481 STR_COULD_NOT_LOAD_FILE,
482 "$filename$", sFile
483 ) );
485 }
486
487 m_pFileStream->SetEndian(SvStreamEndian::LITTLE);
488 m_pFileStream->SetBufferSize(DINDEX_PAGE_SIZE);
489
490 // firstly the result must be sorted
493 OUString aName;
494 try
495 {
496 xStmt.set( m_pTable->getConnection()->createStatement(), UNO_SET_THROW);
497
498 aName = getString(xCol->getFastPropertyValue(PROPERTY_ID_NAME));
499
500 const OUString aQuote(m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString());
501 OUString aStatement( "SELECT " + aQuote + aName + aQuote +" FROM " + aQuote + m_pTable->getName() + aQuote + " ORDER BY " + aQuote + aName + aQuote);
502
503 xSet.set( xStmt->executeQuery(aStatement),UNO_SET_THROW );
504 }
505 catch(const Exception& )
506 {
507 impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX,sFile);
508 }
509 if (!xSet.is())
510 {
511 impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX,sFile);
512 }
513
514 // Set the header info
515 memset(&m_aHeader,0,sizeof(m_aHeader));
516 sal_Int32 nType = 0;
518 const Reference< XPropertySet > xTableCol(*find(aCols->begin(),aCols->end(),aName,::comphelper::UStringMixEqual(isCaseSensitive())));
519
520 xTableCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
521
522 m_aHeader.db_keytype = (nType == DataType::VARCHAR || nType == DataType::CHAR) ? 0 : 1;
523 m_aHeader.db_keylen = (m_aHeader.db_keytype) ? 8 : static_cast<sal_uInt16>(getINT32(xTableCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))));
524 m_aHeader.db_keylen = (( m_aHeader.db_keylen - 1) / 4 + 1) * 4;
526 if ( m_aHeader.db_maxkeys < 3 )
527 {
528 impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX_KEYSIZE,sFile);
529 }
530
531 m_pFileStream->SetStreamSize(DINDEX_PAGE_SIZE);
532
534 strncpy(m_aHeader.db_name, aCol.getStr(), std::min<size_t>(sizeof(m_aHeader.db_name), aCol.getLength()));
537
538 // modifications of the header are detected by differences between
539 // the HeaderInfo and nRootPage or nPageCount respectively
540 m_nRootPage = 1;
541 m_nPageCount = 2;
542
544 m_aRoot->SetModified(true);
545
546 m_bUseCollector = true;
547
548 sal_Int32 nRowsLeft = 0;
549 Reference<XRow> xRow(xSet,UNO_QUERY);
550
551 if(xSet->last())
552 {
553 ODbaseResultSet* pDbaseRes = dynamic_cast<ODbaseResultSet*>(xSet.getTyped().get());
554 assert(pDbaseRes); //"No dbase resultset found? What's going on here!
555 nRowsLeft = xSet->getRow();
556
557 xSet->beforeFirst();
558 ONDXKey aKey(ORowSetValue(), nType, 0);
559 ONDXKey aInsertKey(ORowSetValue(), nType, 0);
560 // Create the index structure
561 while (xSet->next())
562 {
563 ORowSetValue aValue(m_aHeader.db_keytype ? ORowSetValue(xRow->getDouble(1)) : ORowSetValue(xRow->getString(1)));
564 // checking for duplicate entries
566 {
567 aKey.setValue(aValue);
568 if (aKey == (*m_aCurLeaf)[m_nCurNode].GetKey())
569 {
570 impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX_NOT_UNIQUE,sFile);
571 }
572 }
573 aInsertKey.setValue(aValue);
574 aInsertKey.setRecord(pDbaseRes->getCurrentFilePos());
575
576 ONDXNode aNewNode(aInsertKey);
577 if (!m_aCurLeaf->Insert(aNewNode, --nRowsLeft))
578 break;
579 }
580 }
581
582 if(nRowsLeft)
583 {
584 impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX,sFile);
585 }
586 Release();
588}
589
590
591/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
IMPLEMENT_SERVICE_INFO(ODbaseIndex,"com.sun.star.sdbcx.driver.dbase.Index","com.sun.star.sdbcx.Index")
constexpr OStringLiteral dBASE_III_GROUP
Definition: DIndex.hxx:26
void DeleteKey(std::string_view rKey)
OString GetKeyName(sal_uInt16 nKey) const
void SetGroup(const OString &rGroup)
sal_uInt16 GetKeyCount() const
OString ReadKey(const OString &rKey) const
void WriteKey(const OString &rKey, const OString &rValue)
sal_uInt64 Tell() const
std::size_t WriteBytes(const void *pData, std::size_t nSize)
SvStream & WriteUChar(unsigned char nChar)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
ErrCode GetError() const
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
SvStream & ReadUChar(unsigned char &rChar)
::dbtools::OPropertyMap & getPropMap()
Definition: TConnection.cxx:68
rtl_TextEncoding getTextEncoding() const
Definition: TConnection.hxx:61
const OUString & getURL() const
Definition: TConnection.hxx:62
const SharedResources & getResources() const
Definition: TConnection.hxx:65
void throwGenericSQLException(TranslateId pErrorResourceId, const css::uno::Reference< css::uno::XInterface > &_xContext)
Definition: TConnection.cxx:74
OUString getString() const
Definition: FValue.cxx:933
double getDouble() const
Definition: FValue.cxx:1745
OUString getResourceStringWithSubstitution(TranslateId pResId, const char *_pAsciiPatternToReplace, const OUString &_rStringToSubstitute) const
loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
bool Insert(sal_uInt32 nRec, const ORowSetValue &rValue)
Definition: DIndex.cxx:187
bool Update(sal_uInt32 nRec, const ORowSetValue &, const ORowSetValue &)
Definition: DIndex.cxx:211
ODbaseIndex(ODbaseTable *_pTable)
Definition: DIndex.cxx:54
std::vector< ONDXPage * > m_aCollector
Definition: DIndex.hxx:70
virtual void refreshColumns() override
Definition: DIndex.cxx:84
OUString getCompletePath() const
Definition: DIndex.cxx:361
ONDXPagePtr const & getRoot()
Definition: DIndex.cxx:102
bool Find(sal_uInt32 nRec, const ORowSetValue &rValue)
Definition: DIndex.cxx:176
std::unique_ptr< OIndexIterator > createIterator()
Definition: DIndex.cxx:142
bool Delete(sal_uInt32 nRec, const ORowSetValue &rValue)
Definition: DIndex.cxx:224
bool ConvertToKey(ONDXKey *rKey, sal_uInt32 nRec, const ORowSetValue &rValue)
Definition: DIndex.cxx:148
void Release(bool bSave=true)
Definition: DIndex.cxx:251
ONDXPage * CreatePage(sal_uInt32 nPagePos, ONDXPage *pParent=nullptr, bool bLoad=false)
Definition: DIndex.cxx:293
virtual ~ODbaseIndex() override
Definition: DIndex.cxx:79
std::unique_ptr< SvStream > m_pFileStream
Definition: DIndex.hxx:67
void impl_killFileAndthrowError_throw(TranslateId pErrorId, const OUString &_sFile)
Definition: DIndex.cxx:446
friend SvStream & WriteODbaseIndex(SvStream &rStream, const ODbaseIndex &)
virtual void setValue(const ORowSetValue &_rVal) override
Definition: dindexnode.cxx:782
void setRecord(sal_uInt32 _nRec)
Definition: dindexnode.hxx:59
void SetParent(ONDXPagePtr aPa)
Definition: dindexnode.hxx:212
void SetPagePos(sal_uInt32 nPage)
Definition: dindexnode.hxx:193
bool Find(const ONDXKey &)
Definition: dindexnode.cxx:150
bool Insert(ONDXNode &rNode, sal_uInt32 nRowsLeft=0)
Definition: dindexnode.cxx:184
void Release(bool bSave=true)
Definition: dindexnode.cxx:341
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData() override
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement() override
OUString SAL_CALL getName() override
Definition: FTable.hxx:81
const ::rtl::Reference< OSQLColumns > & getTableColumns() const
Definition: FTable.hxx:72
OConnection * getConnection() const
Definition: FTable.hxx:66
std::unique_ptr< OCollection > m_pColumns
Definition: VIndex.hxx:54
virtual void construct() override
Definition: VIndex.cxx:116
mutable::osl::Mutex m_aMutex
const OUString & getNameByIndex(sal_Int32 _nIndex) const
Definition: propertyids.cxx:95
const css::uno::Reference< INTERFACE > & getTyped() const
bool set(const css::uno::BaseReference &_rRef, css::uno::UnoReference_Query _query)
#define DINDEX_PAGE_SIZE
Definition: dindexnode.hxx:26
#define NODE_NOTFOUND
Definition: dindexnode.hxx:25
OUString aName
#define SAL_WARN_IF(condition, area, stream)
@ Exception
sal_Int32 getINT32(const Any &_rAny)
OUString getString(const Any &_rAny)
void ReadHeader(SvStream &rStream, ODbaseIndex::NDXHeader &rHeader)
Definition: DIndex.cxx:314
SvStream & operator>>(SvStream &rStream, ODbaseIndex &)
Definition: DIndex.cxx:333
SvStream & WriteODbaseIndex(SvStream &rStream, const ODbaseIndex &)
Definition: DIndex.cxx:343
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
Definition: dbtools.cxx:1958
void throwFunctionSequenceException(const Reference< XInterface > &Context, const Any &Next)
void throwGenericSQLException(const OUString &_rMsg, const css::uno::Reference< css::uno::XInterface > &_rxSource)
throw a generic SQLException, i.e.
int i
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Definition: pq_tools.cxx:100
#define PROPERTY_ID_NAME
Definition: propertyids.hxx:50
#define PROPERTY_ID_TYPE
Definition: propertyids.hxx:51
#define PROPERTY_ID_PRECISION
Definition: propertyids.hxx:53
#define PROPERTY_ID_DELIMITER
Definition: propertyids.hxx:87
QPRO_FUNC_TYPE nType