cid#1640468 Dereference after null check
[LibreOffice.git] / connectivity / source / inc / FDatabaseMetaDataResultSetMetaData.hxx
blob9de12267229c376b6901b44cf0108bcf6f1bbb27
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
23 #include <cppuhelper/implbase.hxx>
24 #include <map>
25 #include <vector>
26 #include "OColumn.hxx"
28 namespace connectivity
31 //************ Class: ODatabaseMetaDataResultSetMetaData
33 typedef ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
35 class ODatabaseMetaDataResultSetMetaData : public ODatabaseMetaResultSetMetaData_BASE
37 std::map<sal_Int32,connectivity::OColumn> m_mColumns;
38 std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
40 protected:
41 virtual ~ODatabaseMetaDataResultSetMetaData() override;
42 public:
43 // a Constructor, that is needed for when returning the object is needed:
44 ODatabaseMetaDataResultSetMetaData( )
48 virtual sal_Int32 SAL_CALL getColumnCount( ) override;
49 virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
50 virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
51 virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
52 virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
53 virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
54 virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
55 virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
56 virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
57 virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
58 virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
59 virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
60 virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
61 virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
62 virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
63 virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
64 virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
65 virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
66 virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
67 virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
68 virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
70 // methods to set the right column mapping
71 void setColumnPrivilegesMap();
72 void setColumnMap();
73 void setColumnsMap();
74 void setTableNameMap();
75 void setTablesMap();
76 void setProcedureColumnsMap();
77 void setPrimaryKeysMap();
78 void setIndexInfoMap();
79 void setTablePrivilegesMap();
80 void setCrossReferenceMap();
81 void setTypeInfoMap();
82 void setProcedureNameMap();
83 void setProceduresMap();
84 void setTableTypes();
85 void setBestRowIdentifierMap() { setVersionColumnsMap();}
86 void setVersionColumnsMap();
87 void setExportedKeysMap() { setCrossReferenceMap(); }
88 void setImportedKeysMap() { setCrossReferenceMap(); }
89 void setCatalogsMap();
90 void setSchemasMap();
91 void setUDTsMap();
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */