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 _CONNECTIVITY_OTYPEINFO_HXX_
21 : #define _CONNECTIVITY_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 : ::rtl::OUString aTypeName; // Name of the type in the database
32 : ::rtl::OUString aLiteralPrefix; // Prefix for quoting
33 : ::rtl::OUString aLiteralSuffix; // Suffix for quoting
34 : ::rtl::OUString aCreateParams; // Parameter for creating
35 : ::rtl::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 : sal_Bool bCurrency : 1, // Currency
47 : bAutoIncrement : 1, // Is it an autoincrementing field?
48 : bNullable : 1, // Can the field be NULL?
49 : bCaseSensitive : 1, // Is the type case sensitive?
50 : bUnsigned : 1, // Is the type unsigned?
51 : bEmpty_1 : 1, // for later use
52 : bEmpty_2 : 1;
53 :
54 : OTypeInfo()
55 : :nPrecision(0)
56 : ,nMaximumScale(0)
57 : ,nMinimumScale(0)
58 : ,nType( ::com::sun::star::sdbc::DataType::OTHER)
59 : ,nSearchType( ::com::sun::star::sdbc::ColumnSearch::FULL)
60 : ,bCurrency(sal_False)
61 : ,bAutoIncrement(sal_False)
62 : ,bNullable(sal_True)
63 : ,bCaseSensitive(sal_False)
64 : ,bUnsigned(sal_False)
65 : {}
66 :
67 : inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
68 : { return ::rtl_allocateMemory( nSize ); }
69 : inline static void * SAL_CALL operator new( size_t /*nSize*/,void* _pHint ) SAL_THROW(())
70 : { return _pHint; }
71 : inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
72 : { ::rtl_freeMemory( pMem ); }
73 : inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW(())
74 : { }
75 :
76 : sal_Bool operator == (const OTypeInfo& lh) const { return lh.nType == nType; }
77 : sal_Bool operator != (const OTypeInfo& lh) const { return lh.nType != nType; }
78 :
79 : inline ::rtl::OUString getDBName() const { return aTypeName; }
80 : };
81 : }
82 : #endif // _CONNECTIVITY_OTYPEINFO_HXX_
83 :
84 :
85 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|