LibreOffice Module connectivity (master) 1
mysqlc_resultsetmetadata.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 "mysqlc_connection.hxx"
23
24#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
25#include <com/sun/star/sdbc/XConnection.hpp>
26#include <com/sun/star/sdbc/SQLException.hpp>
27
29#include <mysql.h>
30
32{
34{
35 OUString columnName;
36 sal_Int32 length = 0;
37 sal_Int32 type = 0;
38 enum_field_types mysql_type = {};
39 unsigned charsetNumber = 0;
40 unsigned flags = 0;
41 OUString schemaName;
42 OUString tableName;
43 OUString catalogName;
44 sal_Int32 decimals;
45 sal_Int32 max_length;
46};
47
48//************ Class: ResultSetMetaData
49
50typedef ::cppu::WeakImplHelper1<css::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
51
53{
54private:
56 std::vector<MySqlFieldInfo> m_fields;
57
58 void checkColumnIndex(sal_Int32 columnIndex);
59 virtual ~OResultSetMetaData() override = default;
60
61public:
62 OResultSetMetaData(OConnection& rConn, MYSQL_RES* pResult);
63
64 sal_Int32 SAL_CALL getColumnCount() override;
65
66 sal_Bool SAL_CALL isAutoIncrement(sal_Int32 column) override;
67 sal_Bool SAL_CALL isCaseSensitive(sal_Int32 column) override;
68 sal_Bool SAL_CALL isSearchable(sal_Int32 column) override;
69 sal_Bool SAL_CALL isCurrency(sal_Int32 column) override;
70
71 sal_Int32 SAL_CALL isNullable(sal_Int32 column) override;
72
73 sal_Bool SAL_CALL isSigned(sal_Int32 column) override;
74
75 sal_Int32 SAL_CALL getColumnDisplaySize(sal_Int32 column) override;
76
77 OUString SAL_CALL getColumnLabel(sal_Int32 column) override;
78 OUString SAL_CALL getColumnName(sal_Int32 column) override;
79 OUString SAL_CALL getSchemaName(sal_Int32 column) override;
80
81 sal_Int32 SAL_CALL getPrecision(sal_Int32 column) override;
82 sal_Int32 SAL_CALL getScale(sal_Int32 column) override;
83
84 OUString SAL_CALL getTableName(sal_Int32 column) override;
85 OUString SAL_CALL getCatalogName(sal_Int32 column) override;
86
87 sal_Int32 SAL_CALL getColumnType(sal_Int32 column) override;
88
89 OUString SAL_CALL getColumnTypeName(sal_Int32 column) override;
90
91 sal_Bool SAL_CALL isReadOnly(sal_Int32 column) override;
92 sal_Bool SAL_CALL isWritable(sal_Int32 column) override;
93 sal_Bool SAL_CALL isDefinitelyWritable(sal_Int32 column) override;
94
95 OUString SAL_CALL getColumnServiceName(sal_Int32 column) override;
96};
97}
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Bool SAL_CALL isSearchable(sal_Int32 column) override
sal_Int32 SAL_CALL getPrecision(sal_Int32 column) override
OUString SAL_CALL getSchemaName(sal_Int32 column) override
sal_Bool SAL_CALL isCaseSensitive(sal_Int32 column) override
sal_Bool SAL_CALL isCurrency(sal_Int32 column) override
sal_Int32 SAL_CALL getColumnType(sal_Int32 column) override
OUString SAL_CALL getColumnTypeName(sal_Int32 column) override
sal_Bool SAL_CALL isReadOnly(sal_Int32 column) override
OUString SAL_CALL getColumnLabel(sal_Int32 column) override
sal_Bool SAL_CALL isWritable(sal_Int32 column) override
sal_Bool SAL_CALL isAutoIncrement(sal_Int32 column) override
OUString SAL_CALL getCatalogName(sal_Int32 column) override
virtual ~OResultSetMetaData() override=default
sal_Int32 SAL_CALL isNullable(sal_Int32 column) override
OUString SAL_CALL getColumnServiceName(sal_Int32 column) override
sal_Bool SAL_CALL isSigned(sal_Int32 column) override
OUString SAL_CALL getTableName(sal_Int32 column) override
OUString SAL_CALL getColumnName(sal_Int32 column) override
OResultSetMetaData(OConnection &rConn, MYSQL_RES *pResult)
sal_Int32 SAL_CALL getScale(sal_Int32 column) override
sal_Int32 SAL_CALL getColumnDisplaySize(sal_Int32 column) override
sal_Bool SAL_CALL isDefinitelyWritable(sal_Int32 column) override
::cppu::WeakImplHelper1< css::sdbc::XResultSetMetaData > OResultSetMetaData_BASE
unsigned char sal_Bool