1 /************************************************************************* 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * 4 * Copyright 2008 by Sun Microsystems, Inc. 5 * 6 * OpenOffice.org - a multi-platform office productivity suite 7 * 8 * $RCSfile: mysqlc_general.hxx,v $ 9 * 10 * $Revision: 1.1.2.3 $ 11 * 12 * This file is part of OpenOffice.org. 13 * 14 * OpenOffice.org is free software: you can redistribute it and/or modify 15 * it under the terms of the GNU Lesser General Public License version 3 16 * only, as published by the Free Software Foundation. 17 * 18 * OpenOffice.org is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU Lesser General Public License version 3 for more details 22 * (a copy is included in the LICENSE file that accompanied this code). 23 * 24 * You should have received a copy of the GNU Lesser General Public License 25 * version 3 along with OpenOffice.org. If not, see 26 * <http://www.openoffice.org/license.html> 27 * for a copy of the LGPLv3 License. 28 ************************************************************************/ 29 30 #ifndef _MYSQLC_GENERAL_ 31 #define _MYSQLC_GENERAL_ 32 33 #include <com/sun/star/uno/XInterface.hpp> 34 #include <com/sun/star/sdbc/SQLException.hpp> 35 36 #include <preextstl.h> 37 #include <cppconn/exception.h> 38 #include <postextstl.h> 39 40 namespace mysqlc_sdbc_driver 41 { 42 rtl::OUString getStringFromAny(const ::com::sun::star::uno::Any& _rAny); 43 44 void throwFeatureNotImplementedException( 45 const sal_Char* _pAsciiFeatureName, 46 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, 47 const ::com::sun::star::uno::Any* _pNextException = NULL 48 ) 49 throw (::com::sun::star::sdbc::SQLException); 50 51 void throwInvalidArgumentException( 52 const sal_Char* _pAsciiFeatureName, 53 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, 54 const ::com::sun::star::uno::Any* _pNextException = NULL 55 ) 56 throw (::com::sun::star::sdbc::SQLException); 57 58 void translateAndThrow(const ::sql::SQLException& _error, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _context, const rtl_TextEncoding encoding); 59 60 int mysqlToOOOType(int mysqlType) throw (); 61 62 63 ::rtl::OUString convert(const ::ext_std::string& _string, const rtl_TextEncoding encoding); 64 65 ::ext_std::string convert(const ::rtl::OUString& _string, const rtl_TextEncoding encoding); 66 } 67 68 #endif 69