Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_OTYPEINFO_HXX
21 : #define INCLUDED_CONNECTIVITY_SOURCE_INC_OTYPEINFO_HXX
22 :
23 : #include <com/sun/star/sdbc/ColumnSearch.hpp>
24 : #include <com/sun/star/sdbc/DataType.hpp>
25 : #include <connectivity/dbtoolsdllapi.hxx>
26 :
27 : namespace connectivity
28 : {
29 0 : struct OTypeInfo
30 : {
31 : OUString aTypeName; // Name of the type in the database
32 : OUString aLiteralPrefix; // Prefix for quoting
33 : OUString aLiteralSuffix; // Suffix for quoting
34 : OUString aCreateParams; // Parameter for creating
35 : OUString aLocalTypeName;
36 :
37 : sal_Int32 nPrecision; // Length of the type
38 :
39 : sal_Int16 nMaximumScale; // Decimal places
40 : sal_Int16 nMinimumScale; // Minimum decimal places
41 :
42 : sal_Int16 nType; // Database type
43 : sal_Int16 nSearchType; // Can we search for the type?
44 : sal_Int16 nNumPrecRadix; // indicating the radix, which is usually 2 or 10
45 :
46 : bool bCurrency : 1; // Currency
47 : bool bAutoIncrement : 1; // Is it an autoincrementing field?
48 : bool bNullable : 1; // Can the field be NULL?
49 : bool bCaseSensitive : 1; // Is the type case sensitive?
50 : bool bUnsigned : 1; // Is the type unsigned?
51 :
52 : OTypeInfo()
53 : :nPrecision(0)
54 : ,nMaximumScale(0)
55 : ,nMinimumScale(0)
56 : ,nType( ::com::sun::star::sdbc::DataType::OTHER)
57 : ,nSearchType( ::com::sun::star::sdbc::ColumnSearch::FULL)
58 : ,nNumPrecRadix(0)
59 : ,bCurrency(false)
60 : ,bAutoIncrement(false)
61 : ,bNullable(true)
62 : ,bCaseSensitive(false)
63 : ,bUnsigned(false)
64 : {}
65 :
66 : inline static void * SAL_CALL operator new( size_t nSize )
67 : { return ::rtl_allocateMemory( nSize ); }
68 : inline static void * SAL_CALL operator new( size_t /*nSize*/,void* _pHint )
69 : { return _pHint; }
70 : inline static void SAL_CALL operator delete( void * pMem )
71 : { ::rtl_freeMemory( pMem ); }
72 : inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ )
73 : { }
74 :
75 : bool operator == (const OTypeInfo& lh) const { return lh.nType == nType; }
76 : bool operator != (const OTypeInfo& lh) const { return lh.nType != nType; }
77 :
78 : inline OUString getDBName() const { return aTypeName; }
79 : };
80 : }
81 :
82 : #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_OTYPEINFO_HXX
83 :
84 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|