bump product version to 6.3.0.0.beta1
[LibreOffice.git] / connectivity / source / drivers / mysqlc / mysqlc_resultsetmetadata.hxx
blob52ca9595b9ba0e79e7e6a6292f60b39e3b725dc4
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 #ifndef INCLUDED_MYSQLC_SOURCE_MYSQLC_RESULTSETMETADATA_HXX
21 #define INCLUDED_MYSQLC_SOURCE_MYSQLC_RESULTSETMETADATA_HXX
23 #include "mysqlc_connection.hxx"
25 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
26 #include <com/sun/star/sdbc/XConnection.hpp>
27 #include <com/sun/star/sdbc/SQLException.hpp>
29 #include <cppuhelper/implbase1.hxx>
30 #include <mysql.h>
32 namespace connectivity
34 namespace mysqlc
36 using ::com::sun::star::sdbc::SQLException;
37 using ::com::sun::star::uno::RuntimeException;
38 using ::com::sun::star::uno::RuntimeException;
40 struct MySqlFieldInfo
42 OUString columnName;
43 sal_Int32 length = 0;
44 sal_Int32 type = 0;
45 enum_field_types mysql_type = {};
46 unsigned charsetNumber = 0;
47 unsigned flags = 0;
48 OUString schemaName;
49 OUString tableName;
50 OUString catalogName;
51 sal_Int32 decimals;
52 sal_Int32 max_length;
55 //************ Class: ResultSetMetaData
57 typedef ::cppu::WeakImplHelper1<css::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
59 class OResultSetMetaData final : public OResultSetMetaData_BASE
61 private:
62 OConnection& m_rConnection;
63 std::vector<MySqlFieldInfo> m_fields;
65 void checkColumnIndex(sal_Int32 columnIndex);
66 virtual ~OResultSetMetaData() override = default;
68 public:
69 OResultSetMetaData(OConnection& rConn, MYSQL_RES* pResult);
71 sal_Int32 SAL_CALL getColumnCount() override;
73 sal_Bool SAL_CALL isAutoIncrement(sal_Int32 column) override;
74 sal_Bool SAL_CALL isCaseSensitive(sal_Int32 column) override;
75 sal_Bool SAL_CALL isSearchable(sal_Int32 column) override;
76 sal_Bool SAL_CALL isCurrency(sal_Int32 column) override;
78 sal_Int32 SAL_CALL isNullable(sal_Int32 column) override;
80 sal_Bool SAL_CALL isSigned(sal_Int32 column) override;
82 sal_Int32 SAL_CALL getColumnDisplaySize(sal_Int32 column) override;
84 OUString SAL_CALL getColumnLabel(sal_Int32 column) override;
85 OUString SAL_CALL getColumnName(sal_Int32 column) override;
86 OUString SAL_CALL getSchemaName(sal_Int32 column) override;
88 sal_Int32 SAL_CALL getPrecision(sal_Int32 column) override;
89 sal_Int32 SAL_CALL getScale(sal_Int32 column) override;
91 OUString SAL_CALL getTableName(sal_Int32 column) override;
92 OUString SAL_CALL getCatalogName(sal_Int32 column) override;
94 sal_Int32 SAL_CALL getColumnType(sal_Int32 column) override;
96 OUString SAL_CALL getColumnTypeName(sal_Int32 column) override;
98 sal_Bool SAL_CALL isReadOnly(sal_Int32 column) override;
99 sal_Bool SAL_CALL isWritable(sal_Int32 column) override;
100 sal_Bool SAL_CALL isDefinitelyWritable(sal_Int32 column) override;
102 OUString SAL_CALL getColumnServiceName(sal_Int32 column) override;
107 #endif // INCLUDED_MYSQLC_SOURCE_MYSQLC_RESULTSETMETADATA_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */