1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _CONNECTIVITY_OTYPEINFO_HXX_ 25 #define _CONNECTIVITY_OTYPEINFO_HXX_ 26 27 #include <com/sun/star/sdbc/ColumnSearch.hpp> 28 #include <com/sun/star/sdbc/DataType.hpp> 29 #include "connectivity/dbtoolsdllapi.hxx" 30 31 namespace connectivity 32 { 33 struct OTypeInfo 34 { 35 ::rtl::OUString aTypeName; // Name des Types in der Datenbank 36 ::rtl::OUString aLiteralPrefix; // Prefix zum Quoten 37 ::rtl::OUString aLiteralSuffix; // Suffix zum Quoten 38 ::rtl::OUString aCreateParams; // Parameter zum Erstellen 39 ::rtl::OUString aLocalTypeName; 40 41 sal_Int32 nPrecision; // Laenge des Types 42 43 sal_Int16 nMaximumScale; // Nachkommastellen 44 sal_Int16 nMinimumScale; // Min Nachkommastellen 45 46 sal_Int16 nType; // Datenbanktyp 47 sal_Int16 nSearchType; // kann nach dem Typen gesucht werden 48 sal_Int16 nNumPrecRadix; // indicating the radix, which is usually 2 or 10 49 50 sal_Bool bCurrency : 1, // Waehrung 51 bAutoIncrement : 1, // Ist es ein automatisch incrementierendes Feld 52 bNullable : 1, // Kann das Feld NULL annehmen 53 bCaseSensitive : 1, // Ist der Type Casesensitive 54 bUnsigned : 1, // Ist der Type Unsigned 55 bEmpty_1 : 1, // for later use 56 bEmpty_2 : 1; 57 OTypeInfoconnectivity::OTypeInfo58 OTypeInfo() 59 :nPrecision(0) 60 ,nMaximumScale(0) 61 ,nMinimumScale(0) 62 ,nType( ::com::sun::star::sdbc::DataType::OTHER) 63 ,nSearchType( ::com::sun::star::sdbc::ColumnSearch::FULL) 64 ,bCurrency(sal_False) 65 ,bAutoIncrement(sal_False) 66 ,bNullable(sal_True) 67 ,bCaseSensitive(sal_False) 68 ,bUnsigned(sal_False) 69 {} 70 operator newconnectivity::OTypeInfo71 inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () ) 72 { return ::rtl_allocateMemory( nSize ); } operator newconnectivity::OTypeInfo73 inline static void * SAL_CALL operator new( size_t /*nSize*/,void* _pHint ) SAL_THROW( () ) 74 { return _pHint; } operator deleteconnectivity::OTypeInfo75 inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () ) 76 { ::rtl_freeMemory( pMem ); } operator deleteconnectivity::OTypeInfo77 inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW( () ) 78 { } 79 operator ==connectivity::OTypeInfo80 sal_Bool operator == (const OTypeInfo& lh) const { return lh.nType == nType; } operator !=connectivity::OTypeInfo81 sal_Bool operator != (const OTypeInfo& lh) const { return lh.nType != nType; } 82 getDBNameconnectivity::OTypeInfo83 inline ::rtl::OUString getDBName() const { return aTypeName; } 84 }; 85 } 86 #endif // _CONNECTIVITY_OTYPEINFO_HXX_ 87 88 89