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