1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
32 namespace connectivity
36 using ::com::sun::star::sdbc::SQLException
;
37 using ::com::sun::star::uno::RuntimeException
;
38 using ::com::sun::star::uno::RuntimeException
;
45 enum_field_types mysql_type
= {};
46 unsigned charsetNumber
= 0;
55 //************ Class: ResultSetMetaData
57 typedef ::cppu::WeakImplHelper1
<css::sdbc::XResultSetMetaData
> OResultSetMetaData_BASE
;
59 class OResultSetMetaData final
: public OResultSetMetaData_BASE
62 OConnection
& m_rConnection
;
63 std::vector
<MySqlFieldInfo
> m_fields
;
65 void checkColumnIndex(sal_Int32 columnIndex
);
66 virtual ~OResultSetMetaData() override
= default;
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: */