LibreOffice Module connectivity (master) 1
FTable.hxx
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#pragma once
21
23#include <file/FConnection.hxx>
24#include <file/filedllapi.hxx>
25#include <tools/stream.hxx>
27#include <TResultSetHelper.hxx>
28
29namespace connectivity::file
30 {
32
34 {
35 protected:
37 std::unique_ptr<SvStream> m_pFileStream;
39 sal_Int32 m_nFilePos; // current IResultSetHelper::Movement
40 std::unique_ptr<sal_uInt8[]> m_pBuffer;
41 sal_uInt16 m_nBufferSize; // size of the ReadBuffer, if pBuffer != NULL
42 bool m_bWriteable; // svstream can't say if we are writeable
43 // so we have to
44
45 virtual void FileClose();
46 virtual ~OFileTable( ) override;
47 public:
48 virtual void refreshColumns() override;
49 virtual void refreshKeys() override;
50 virtual void refreshIndexes() override;
51 public:
52 OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection);
53 OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection,
54 const OUString& Name,
55 const OUString& Type,
56 const OUString& Description,
57 const OUString& SchemaName,
58 const OUString& CatalogName
59 );
60
61 //XInterface
62 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
63 // ::cppu::OComponentHelper
64 virtual void SAL_CALL disposing() override;
65
66 OConnection* getConnection() const { return m_pConnection;}
67 virtual sal_Int32 getCurrentLastPos() const {return -1;}
68
69 virtual bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos) = 0;
70 virtual bool fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, bool bRetrieveData) = 0;
71
72 const ::rtl::Reference<OSQLColumns>& getTableColumns() const {return m_aColumns;}
73 virtual bool InsertRow(OValueRefVector& rRow, const css::uno::Reference< css::container::XIndexAccess>& _xCols);
74 virtual bool DeleteRow(const OSQLColumns& _rCols);
75 virtual bool UpdateRow(OValueRefVector& rRow, OValueRefRow& pOrgRow,const css::uno::Reference< css::container::XIndexAccess>& _xCols);
76 virtual void addColumn(const css::uno::Reference< css::beans::XPropertySet>& descriptor);
77 virtual void dropColumn(sal_Int32 _nPos);
78 // refresh the header of file based tables to see changes done by someone
79 virtual void refreshHeader();
80
81 OUString SAL_CALL getName() override { return m_Name; }
82
83 const OUString& getSchema() const { return m_SchemaName; }
84 bool isReadOnly() const { return !m_bWriteable; }
85 // m_pFileStream && !m_pFileStream->IsWritable(); }
86
87 sal_Int32 getFilePos() const { return m_nFilePos; }
88
89 public:
90 // helper
91
92 // creates a stream using ::utl::UcbStreamHelper::CreateStream, but the error is simplified
93 // (NULL or non-NULL is returned)
94 static std::unique_ptr<SvStream> createStream_simpleError( const OUString& _rFileName, StreamMode _eOpenMode);
95 };
96
97}
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString m_Name
OConnection * m_pConnection
Definition: FTable.hxx:36
virtual bool fetchRow(OValueRefRow &_rRow, const OSQLColumns &_rCols, bool bRetrieveData)=0
virtual sal_Int32 getCurrentLastPos() const
Definition: FTable.hxx:67
const OUString & getSchema() const
Definition: FTable.hxx:83
sal_Int32 getFilePos() const
Definition: FTable.hxx:87
OUString SAL_CALL getName() override
Definition: FTable.hxx:81
::rtl::Reference< OSQLColumns > m_aColumns
Definition: FTable.hxx:38
std::unique_ptr< sal_uInt8[]> m_pBuffer
Definition: FTable.hxx:40
std::unique_ptr< SvStream > m_pFileStream
Definition: FTable.hxx:37
const ::rtl::Reference< OSQLColumns > & getTableColumns() const
Definition: FTable.hxx:72
OConnection * getConnection() const
Definition: FTable.hxx:66
virtual bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32 &nCurPos)=0
#define OOO_DLLPUBLIC_FILE
Definition: filedllapi.hxx:29
Type
connectivity::sdbcx::OTable OTable_TYPEDEF
Definition: FTable.hxx:31
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
StreamMode