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_OCOLUMN_HXX
21 : #define INCLUDED_CONNECTIVITY_SOURCE_INC_OCOLUMN_HXX
22 :
23 : #include <rtl/ustring.hxx>
24 : #include <sal/types.h>
25 : #include <connectivity/dbtoolsdllapi.hxx>
26 :
27 : namespace connectivity
28 : {
29 13428 : class OOO_DLLPUBLIC_DBTOOLS OColumn
30 : {
31 : OUString m_CatalogName;
32 : OUString m_SchemaName;
33 : OUString m_TableName;
34 : OUString m_ColumnName;
35 : OUString m_ColumnLabel;
36 : OUString m_ColumnTypeName;
37 : OUString m_ColumnServiceName;
38 :
39 : sal_Int32 m_Nullable;
40 : sal_Int32 m_ColumnDisplaySize;
41 : sal_Int32 m_Precision;
42 : sal_Int32 m_Scale;
43 : sal_Int32 m_ColumnType;
44 :
45 : bool m_AutoIncrement;
46 : bool m_CaseSensitive;
47 : bool m_Searchable;
48 : bool m_Currency;
49 : bool m_Signed;
50 : bool m_ReadOnly;
51 : bool m_Writable;
52 : bool m_DefinitelyWritable;
53 :
54 : public:
55 4476 : OColumn()
56 : : m_Nullable(0)
57 : , m_ColumnDisplaySize(0)
58 : , m_Precision(0)
59 : , m_Scale(0)
60 : , m_ColumnType(0)
61 :
62 : , m_AutoIncrement(false)
63 : , m_CaseSensitive(false)
64 : , m_Searchable(true)
65 : , m_Currency(false)
66 : , m_Signed(false)
67 : , m_ReadOnly(true)
68 : , m_Writable(false)
69 4476 : , m_DefinitelyWritable(false)
70 4476 : {}
71 :
72 4476 : OColumn(const OUString &_aTableName,
73 : const OUString &_aColumnName,
74 :
75 : sal_Int32 _aNullable=0,
76 : sal_Int32 _aColumnDisplaySize=0,
77 : sal_Int32 _aPrecision=0,
78 : sal_Int32 _aScale=0,
79 : sal_Int32 _aColumnType=0,
80 :
81 : bool _aAutoIncrement=false,
82 : bool _aCaseSensitive=false,
83 : bool _aSearchable=true,
84 : bool _aCurrency=false,
85 : bool _aSigned=false,
86 : bool _aReadOnly=true,
87 : bool _aWritable=false,
88 : bool _aDefinitelyWritable=false,
89 :
90 : const OUString &_aColumnLabel = OUString(),
91 : const OUString &_aColumnTypeName = OUString(),
92 : const OUString &_aColumnServiceName = OUString())
93 : : m_TableName(_aTableName),
94 : m_ColumnName(_aColumnName),
95 : m_ColumnLabel(_aColumnLabel),
96 : m_ColumnTypeName(_aColumnTypeName),
97 : m_ColumnServiceName(_aColumnServiceName),
98 :
99 : m_Nullable(_aNullable),
100 : m_ColumnDisplaySize(_aColumnDisplaySize),
101 : m_Precision(_aPrecision),
102 : m_Scale(_aScale),
103 : m_ColumnType(_aColumnType),
104 :
105 : m_AutoIncrement(_aAutoIncrement),
106 : m_CaseSensitive(_aCaseSensitive),
107 : m_Searchable(_aSearchable),
108 : m_Currency(_aCurrency),
109 : m_Signed(_aSigned),
110 : m_ReadOnly(_aReadOnly),
111 : m_Writable(_aWritable),
112 4476 : m_DefinitelyWritable(_aDefinitelyWritable)
113 : {
114 4476 : if(m_ColumnLabel.isEmpty())
115 4476 : m_ColumnLabel = _aColumnName;
116 4476 : }
117 :
118 : inline static void * SAL_CALL operator new( size_t nSize )
119 : { return ::rtl_allocateMemory( nSize ); }
120 : inline static void * SAL_CALL operator new( size_t ,void* _pHint )
121 : { return _pHint; }
122 : inline static void SAL_CALL operator delete( void * pMem )
123 : { ::rtl_freeMemory( pMem ); }
124 : inline static void SAL_CALL operator delete( void *,void* )
125 : { }
126 :
127 0 : bool isAutoIncrement() const { return m_AutoIncrement; }
128 0 : bool isCaseSensitive() const { return m_CaseSensitive; }
129 0 : bool isSearchable() const { return m_Searchable; }
130 0 : bool isCurrency() const { return m_Currency; }
131 0 : bool isSigned() const { return m_Signed; }
132 : bool isReadOnly() const { return m_ReadOnly; }
133 : bool isWritable() const { return m_Writable; }
134 : bool isDefinitelyWritable() const { return m_DefinitelyWritable; }
135 :
136 0 : sal_Int32 isNullable() const { return m_Nullable; }
137 0 : sal_Int32 getColumnDisplaySize() const { return m_ColumnDisplaySize; }
138 0 : sal_Int32 getPrecision() const { return m_Precision; }
139 0 : sal_Int32 getScale() const { return m_Scale; }
140 0 : sal_Int32 getColumnType() const { return m_ColumnType; }
141 :
142 0 : const OUString& getColumnLabel() const { return m_ColumnLabel; }
143 0 : const OUString& getColumnName() const { return m_ColumnName; }
144 : const OUString& getSchemaName() const { return m_SchemaName; }
145 0 : const OUString& getTableName() const { return m_TableName; }
146 : const OUString& getCatalogName() const { return m_CatalogName; }
147 0 : const OUString& getColumnTypeName() const { return m_ColumnTypeName; }
148 0 : const OUString& getColumnServiceName() const { return m_ColumnServiceName; }
149 :
150 : };
151 : }
152 :
153 : #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_OCOLUMN_HXX
154 :
155 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|