Use correct object
[LibreOffice.git] / connectivity / source / drivers / postgresql / pq_statics.hxx
blob4e745e4086eeec4584ce8d3c8ed4b0e652a739dc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
35 ************************************************************************/
37 #pragma once
39 #include <unordered_map>
40 #include <utility>
41 #include <vector>
43 #include <com/sun/star/uno/Any.hxx>
44 #include <com/sun/star/uno/Sequence.hxx>
46 #include <cppuhelper/propshlp.hxx>
48 namespace pq_sdbc_driver
51 struct ColumnMetaData
53 ColumnMetaData(
54 OUString _columnName,
55 OUString _tableName,
56 OUString _schemaTableName,
57 OUString _typeName,
58 sal_Int32 _type,
59 sal_Int32 _precision,
60 sal_Int32 _scale,
61 bool _isCurrency,
62 bool _isNullable,
63 bool _isAutoIncrement ) :
64 columnName(std::move( _columnName )),
65 tableName(std::move( _tableName )),
66 schemaTableName(std::move( _schemaTableName )),
67 typeName(std::move( _typeName )),
68 type( _type ),
69 precision( _precision ),
70 scale( _scale ),
71 isCurrency( _isCurrency ),
72 isNullable( _isNullable ),
73 isAutoIncrement( _isAutoIncrement )
76 OUString columnName;
77 OUString tableName;
78 OUString schemaTableName;
79 OUString typeName;
80 sal_Int32 type;
81 sal_Int32 precision;
82 sal_Int32 scale;
83 bool isCurrency;
84 bool isNullable;
85 bool isAutoIncrement;
88 typedef std::vector< ColumnMetaData > ColumnMetaDataVector;
90 typedef std::unordered_map
92 OUString,
93 sal_Int32
94 > BaseTypeMap;
96 struct ImplementationStatics
98 ImplementationStatics() :
99 pProps(nullptr)
102 OUString implName;
103 css::uno::Sequence< OUString > serviceNames;
104 cppu::IPropertyArrayHelper *pProps;
105 css::uno::Sequence< css::uno::Type > types;
108 struct ReflectionImplementations
110 struct ImplementationStatics table;
111 struct ImplementationStatics tableDescriptor;
112 struct ImplementationStatics column;
113 struct ImplementationStatics columnDescriptor;
114 struct ImplementationStatics key;
115 struct ImplementationStatics keyDescriptor;
116 struct ImplementationStatics keycolumn;
117 struct ImplementationStatics keycolumnDescriptor;
118 struct ImplementationStatics user;
119 struct ImplementationStatics userDescriptor;
120 struct ImplementationStatics view;
121 struct ImplementationStatics viewDescriptor;
122 struct ImplementationStatics index;
123 struct ImplementationStatics indexDescriptor;
124 struct ImplementationStatics indexColumn;
125 struct ImplementationStatics indexColumnDescriptor;
128 const sal_Int32 TABLE_INDEX_CATALOG = 0;
129 const sal_Int32 TABLE_INDEX_SCHEMA = 1;
130 const sal_Int32 TABLE_INDEX_NAME = 2;
131 const sal_Int32 TABLE_INDEX_TYPE = 3;
132 const sal_Int32 TABLE_INDEX_REMARKS = 4;
134 struct Statics
136 OUString SYSTEM_TABLE;
137 OUString TABLE;
138 OUString VIEW;
139 OUString UNKNOWN;
140 OUString YES;
141 OUString NO;
142 OUString NO_NULLS;
143 OUString NULABLE;
144 OUString NULLABLE_UNKNOWN;
145 OUString SELECT;
146 OUString UPDATE;
147 OUString INSERT;
148 OUString DELETE;
149 OUString RULE;
150 OUString REFERENCES;
151 OUString TRIGGER;
152 OUString EXECUTE;
153 OUString USAGE;
154 OUString CREATE;
155 OUString TEMPORARY;
156 OUString INDEX;
157 OUString INDEX_COLUMN;
159 OUString NAME;
160 OUString SCHEMA_NAME;
161 OUString CATALOG_NAME;
162 OUString DESCRIPTION;
163 OUString TYPE;
164 OUString TYPE_NAME;
165 OUString PRIVILEGES;
167 OUString DEFAULT_VALUE;
168 OUString IS_AUTO_INCREMENT;
169 OUString IS_CURRENCY;
170 OUString IS_NULLABLE;
171 OUString IS_ROW_VERSISON;
172 OUString PRECISION;
173 OUString SCALE;
175 OUString cPERCENT;
177 OUString BEGIN;
178 OUString ROLLBACK;
179 OUString COMMIT;
181 OUString KEY;
182 OUString REFERENCED_TABLE;
183 OUString UPDATE_RULE;
184 OUString DELETE_RULE;
185 OUString PRIVATE_COLUMNS;
186 OUString PRIVATE_FOREIGN_COLUMNS;
188 OUString KEY_COLUMN;
189 OUString RELATED_COLUMN;
191 OUString PASSWORD;
192 OUString USER;
194 OUString CURSOR_NAME;
195 OUString ESCAPE_PROCESSING;
196 OUString FETCH_DIRECTION;
197 OUString FETCH_SIZE;
198 OUString IS_BOOKMARKABLE;
199 OUString RESULT_SET_CONCURRENCY;
200 OUString RESULT_SET_TYPE;
202 OUString COMMAND;
203 OUString CHECK_OPTION;
205 OUString TRUE;
206 OUString FALSE;
208 OUString IS_PRIMARY_KEY_INDEX;
209 OUString IS_CLUSTERED;
210 OUString IS_UNIQUE;
211 OUString PRIVATE_COLUMN_INDEXES;
212 OUString HELP_TEXT;
214 OUString CATALOG;
215 OUString IS_ASCENDING;
216 ReflectionImplementations refl;
218 std::vector< OUString > tablesRowNames;
219 std::vector< OUString > columnRowNames;
220 std::vector< OUString > primaryKeyNames;
221 std::vector< OUString > schemaNames;
222 std::vector< OUString > tableTypeNames;
223 std::vector< OUString > typeinfoColumnNames;
224 std::vector< OUString > indexinfoColumnNames;
225 std::vector< OUString > resultSetArrayColumnNames;
226 std::vector< std::vector< css::uno::Any > > tableTypeData;
228 ColumnMetaDataVector typeInfoMetaData;
229 BaseTypeMap baseTypeMap;
230 Statics(){}
231 private:
232 Statics( const Statics & ) = delete;
233 Statics & operator = ( const Statics & ) = delete;
236 Statics & getStatics();
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */