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 CONNECTIVITY_SRESULSETMETADATA_HXX
21 #define CONNECTIVITY_SRESULSETMETADATA_HXX
23 #include "mysqlc_connection.hxx"
25 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
27 #include <cppuhelper/implbase1.hxx>
28 #include <cppconn/resultset_metadata.h>
30 namespace connectivity
34 using ::com::sun::star::sdbc::SQLException
;
35 using ::com::sun::star::uno::RuntimeException
;
36 using ::rtl::OUString
;
37 //**************************************************************
38 //************ Class: ResultSetMetaData
39 //**************************************************************
40 typedef ::cppu::WeakImplHelper1
< ::com::sun::star::sdbc::XResultSetMetaData
> OResultSetMetaData_BASE
;
42 class OResultSetMetaData
: public OResultSetMetaData_BASE
44 sql::ResultSetMetaData
* meta
;
45 rtl_TextEncoding m_encoding
;
47 virtual ~OResultSetMetaData();
49 OResultSetMetaData( sql::ResultSetMetaData
* _meta
, rtl_TextEncoding _encoding
)
51 ,m_encoding( _encoding
)
55 inline ::rtl::OUString
convert( const ::std::string
& _string
) const
57 return ::rtl::OUString( _string
.c_str(), _string
.size(), m_encoding
);
60 /// Avoid ambigous cast error from the compiler.
61 inline operator ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
> () throw()
64 sal_Int32 SAL_CALL
getColumnCount() throw(SQLException
, RuntimeException
);
66 sal_Bool SAL_CALL
isAutoIncrement(sal_Int32 column
) throw(SQLException
, RuntimeException
);
67 sal_Bool SAL_CALL
isCaseSensitive(sal_Int32 column
) throw(SQLException
, RuntimeException
);
68 sal_Bool SAL_CALL
isSearchable(sal_Int32 column
) throw(SQLException
, RuntimeException
);
69 sal_Bool SAL_CALL
isCurrency(sal_Int32 column
) throw(SQLException
, RuntimeException
);
71 sal_Int32 SAL_CALL
isNullable(sal_Int32 column
) throw(SQLException
, RuntimeException
);
73 sal_Bool SAL_CALL
isSigned(sal_Int32 column
) throw(SQLException
, RuntimeException
);
75 sal_Int32 SAL_CALL
getColumnDisplaySize(sal_Int32 column
)throw(SQLException
, RuntimeException
);
77 OUString SAL_CALL
getColumnLabel(sal_Int32 column
) throw(SQLException
, RuntimeException
);
78 OUString SAL_CALL
getColumnName(sal_Int32 column
) throw(SQLException
, RuntimeException
);
79 OUString SAL_CALL
getSchemaName(sal_Int32 column
) throw(SQLException
, RuntimeException
);
81 sal_Int32 SAL_CALL
getPrecision(sal_Int32 column
) throw(SQLException
, RuntimeException
);
82 sal_Int32 SAL_CALL
getScale(sal_Int32 column
) throw(SQLException
, RuntimeException
);
84 OUString SAL_CALL
getTableName(sal_Int32 column
) throw(SQLException
, RuntimeException
);
85 OUString SAL_CALL
getCatalogName(sal_Int32 column
) throw(SQLException
, RuntimeException
);
87 sal_Int32 SAL_CALL
getColumnType(sal_Int32 column
) throw(SQLException
, RuntimeException
);
89 OUString SAL_CALL
getColumnTypeName(sal_Int32 column
) throw(SQLException
, RuntimeException
);
91 sal_Bool SAL_CALL
isReadOnly(sal_Int32 column
) throw(SQLException
, RuntimeException
);
92 sal_Bool SAL_CALL
isWritable(sal_Int32 column
) throw(SQLException
, RuntimeException
);
93 sal_Bool SAL_CALL
isDefinitelyWritable(sal_Int32 column
)throw(SQLException
, RuntimeException
);
95 OUString SAL_CALL
getColumnServiceName(sal_Int32 column
)throw(SQLException
, RuntimeException
);
97 void checkColumnIndex(sal_Int32 columnIndex
) throw (SQLException
, RuntimeException
);
102 #endif // CONNECTIVITY_SRESULSETMETADATA_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */