1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _CONNECTIVITY_OTYPEINFO_HXX_
30 #define _CONNECTIVITY_OTYPEINFO_HXX_
32 #include <com/sun/star/sdbc/ColumnSearch.hpp>
33 #include <com/sun/star/sdbc/DataType.hpp>
34 #include "connectivity/dbtoolsdllapi.hxx"
36 namespace connectivity
40 ::rtl::OUString aTypeName
; // Name of the type in the database
41 ::rtl::OUString aLiteralPrefix
; // Prefix for quoting
42 ::rtl::OUString aLiteralSuffix
; // Suffix for quoting
43 ::rtl::OUString aCreateParams
; // Parameter for creating
44 ::rtl::OUString aLocalTypeName
;
46 sal_Int32 nPrecision
; // Length of the type
48 sal_Int16 nMaximumScale
; // Decimal places
49 sal_Int16 nMinimumScale
; // Minimum decimal places
51 sal_Int16 nType
; // Database type
52 sal_Int16 nSearchType
; // Can we search for the type?
53 sal_Int16 nNumPrecRadix
; // indicating the radix, which is usually 2 or 10
55 sal_Bool bCurrency
: 1, // Currency
56 bAutoIncrement
: 1, // Is it an autoincrementing field?
57 bNullable
: 1, // Can the field be NULL?
58 bCaseSensitive
: 1, // Is the type case sensitive?
59 bUnsigned
: 1, // Is the type unsigned?
60 bEmpty_1
: 1, // for later use
67 ,nType( ::com::sun::star::sdbc::DataType::OTHER
)
68 ,nSearchType( ::com::sun::star::sdbc::ColumnSearch::FULL
)
70 ,bAutoIncrement(sal_False
)
72 ,bCaseSensitive(sal_False
)
76 inline static void * SAL_CALL
operator new( size_t nSize
) SAL_THROW(())
77 { return ::rtl_allocateMemory( nSize
); }
78 inline static void * SAL_CALL
operator new( size_t /*nSize*/,void* _pHint
) SAL_THROW(())
80 inline static void SAL_CALL
operator delete( void * pMem
) SAL_THROW(())
81 { ::rtl_freeMemory( pMem
); }
82 inline static void SAL_CALL
operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW(())
85 sal_Bool
operator == (const OTypeInfo
& lh
) const { return lh
.nType
== nType
; }
86 sal_Bool
operator != (const OTypeInfo
& lh
) const { return lh
.nType
!= nType
; }
88 inline ::rtl::OUString
getDBName() const { return aTypeName
; }
91 #endif // _CONNECTIVITY_OTYPEINFO_HXX_
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */