LibreOffice Module connectivity (master) 1
ADatabaseMetaDataResultSetMetaData.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
22#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
24#include <vector>
25#include <ado/Awrapado.hxx>
27#include <OColumn.hxx>
28
29namespace connectivity::ado
30{
31
32 //************ Class: ResultSetMetaData
33
34 typedef ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
35
37 {
39
40 const std::vector<sal_Int32> &m_vMapping; // when not every column is needed
41 std::map<sal_Int32,connectivity::OColumn> m_mColumns;
42 std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
43
44 ADORecordset* m_pRecordSet;
45 sal_Int32 m_nColCount;
46
47 private:
50
51 protected:
53 void setColumnsMap();
54 void setTablesMap();
56 void setPrimaryKeysMap();
57 void setIndexInfoMap();
60 void setTypeInfoMap();
61 void setProceduresMap();
62 public:
63 // a Constructor, that is needed for when Returning the Object is needed:
65 : m_vMapping(_pRes->getColumnMapping()),
66 m_pRecordSet(_pRecordSet),
68 {
69 if(m_pRecordSet)
70 m_pRecordSet->AddRef();
71 }
73
75 operator css::uno::Reference< css::sdbc::XResultSetMetaData > () noexcept
76 { return this; }
77
78 virtual sal_Int32 SAL_CALL getColumnCount( ) override;
79 virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
80 virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
81 virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
82 virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
83 virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
84 virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
85 virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
86 virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
87 virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
88 virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
89 virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
90 virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
91 virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
92 virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
93 virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
94 virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
95 virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
96 virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
97 virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
98 virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
99 };
100}
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Bool SAL_CALL isReadOnly(sal_Int32 column) override
virtual sal_Bool SAL_CALL isWritable(sal_Int32 column) override
ODatabaseMetaDataResultSetMetaData & operator=(const ODatabaseMetaDataResultSetMetaData &)
virtual sal_Bool SAL_CALL isSigned(sal_Int32 column) override
virtual OUString SAL_CALL getColumnServiceName(sal_Int32 column) override
virtual sal_Int32 SAL_CALL isNullable(sal_Int32 column) override
virtual sal_Int32 SAL_CALL getColumnDisplaySize(sal_Int32 column) override
ODatabaseMetaDataResultSetMetaData(const ODatabaseMetaDataResultSetMetaData &)
virtual OUString SAL_CALL getColumnName(sal_Int32 column) override
std::map< sal_Int32, connectivity::OColumn >::const_iterator m_mColumnsIter
virtual sal_Int32 SAL_CALL getPrecision(sal_Int32 column) override
virtual OUString SAL_CALL getColumnTypeName(sal_Int32 column) override
virtual OUString SAL_CALL getSchemaName(sal_Int32 column) override
virtual sal_Bool SAL_CALL isCaseSensitive(sal_Int32 column) override
virtual OUString SAL_CALL getCatalogName(sal_Int32 column) override
virtual sal_Int32 SAL_CALL getColumnType(sal_Int32 column) override
ODatabaseMetaDataResultSetMetaData(ADORecordset *_pRecordSet, ODatabaseMetaDataResultSet *_pRes)
virtual OUString SAL_CALL getColumnLabel(sal_Int32 column) override
virtual OUString SAL_CALL getTableName(sal_Int32 column) override
virtual sal_Bool SAL_CALL isAutoIncrement(sal_Int32 column) override
virtual sal_Int32 SAL_CALL getScale(sal_Int32 column) override
virtual sal_Bool SAL_CALL isSearchable(sal_Int32 column) override
virtual sal_Bool SAL_CALL isCurrency(sal_Int32 column) override
virtual sal_Bool SAL_CALL isDefinitelyWritable(sal_Int32 column) override
size
::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData > ODatabaseMetaResultSetMetaData_BASE
unsigned char sal_Bool