1*079eb577SAndrew Rist /**************************************************************
2*079eb577SAndrew Rist  *
3*079eb577SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*079eb577SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*079eb577SAndrew Rist  * distributed with this work for additional information
6*079eb577SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*079eb577SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*079eb577SAndrew Rist  * "License"); you may not use this file except in compliance
9*079eb577SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*079eb577SAndrew Rist  *
11*079eb577SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*079eb577SAndrew Rist  *
13*079eb577SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*079eb577SAndrew Rist  * software distributed under the License is distributed on an
15*079eb577SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*079eb577SAndrew Rist  * KIND, either express or implied.  See the License for the
17*079eb577SAndrew Rist  * specific language governing permissions and limitations
18*079eb577SAndrew Rist  * under the License.
19*079eb577SAndrew Rist  *
20*079eb577SAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #ifndef _MYSQLC_GENERAL_
23cdf0e10cSrcweir #define _MYSQLC_GENERAL_
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #include <com/sun/star/uno/XInterface.hpp>
26cdf0e10cSrcweir #include <com/sun/star/sdbc/SQLException.hpp>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <preextstl.h>
29cdf0e10cSrcweir #include <cppconn/exception.h>
30cdf0e10cSrcweir #include <postextstl.h>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace mysqlc_sdbc_driver
33cdf0e10cSrcweir {
34cdf0e10cSrcweir 	rtl::OUString getStringFromAny(const ::com::sun::star::uno::Any& _rAny);
35cdf0e10cSrcweir 
36cdf0e10cSrcweir     void throwFeatureNotImplementedException(
37cdf0e10cSrcweir             const sal_Char* _pAsciiFeatureName,
38cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
39cdf0e10cSrcweir             const ::com::sun::star::uno::Any* _pNextException = NULL
40cdf0e10cSrcweir         )
41cdf0e10cSrcweir         throw (::com::sun::star::sdbc::SQLException);
42cdf0e10cSrcweir 
43cdf0e10cSrcweir     void throwInvalidArgumentException(
44cdf0e10cSrcweir             const sal_Char* _pAsciiFeatureName,
45cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
46cdf0e10cSrcweir             const ::com::sun::star::uno::Any* _pNextException = NULL
47cdf0e10cSrcweir         )
48cdf0e10cSrcweir         throw (::com::sun::star::sdbc::SQLException);
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	void translateAndThrow(const ::sql::SQLException& _error, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _context, const rtl_TextEncoding encoding);
51cdf0e10cSrcweir 
52cdf0e10cSrcweir 	int mysqlToOOOType(int mysqlType) throw ();
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 	::rtl::OUString convert(const ::ext_std::string& _string, const rtl_TextEncoding encoding);
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	::ext_std::string convert(const ::rtl::OUString& _string, const rtl_TextEncoding encoding);
58cdf0e10cSrcweir }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir #endif
61