xref: /AOO41X/main/connectivity/source/inc/OColumn.hxx (revision caf5cd79edad04a48dcaf209068b3b89eae4622e)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _CONNECTIVITY_COLUMN_HXX_
25 #define _CONNECTIVITY_COLUMN_HXX_
26 
27 #include <rtl/ustring.hxx>
28 #include <sal/types.h>
29 #include "connectivity/dbtoolsdllapi.hxx"
30 
31 namespace connectivity
32 {
33     class OOO_DLLPUBLIC_DBTOOLS OColumn
34     {
35         ::rtl::OUString m_CatalogName;
36         ::rtl::OUString m_SchemaName;
37         ::rtl::OUString m_TableName;
38         ::rtl::OUString m_ColumnName;
39         ::rtl::OUString m_ColumnLabel;
40         ::rtl::OUString m_ColumnTypeName;
41         ::rtl::OUString m_ColumnServiceName;
42 
43         sal_Int32       m_Nullable;
44         sal_Int32       m_ColumnDisplaySize;
45         sal_Int32       m_Precision;
46         sal_Int32       m_Scale;
47         sal_Int32       m_ColumnType;
48 
49         sal_Bool        m_AutoIncrement;
50         sal_Bool        m_CaseSensitive;
51         sal_Bool        m_Searchable;
52         sal_Bool        m_Currency;
53         sal_Bool        m_Signed;
54         sal_Bool        m_ReadOnly;
55         sal_Bool        m_Writable;
56         sal_Bool        m_DefinitelyWritable;
57 
58     public:
OColumn()59         OColumn() {}
OColumn(const::rtl::OUString & _aTableName,const::rtl::OUString & _aColumnName,sal_Int32 _aNullable=0,sal_Int32 _aColumnDisplaySize=0,sal_Int32 _aPrecision=0,sal_Int32 _aScale=0,sal_Int32 _aColumnType=0,sal_Bool _aAutoIncrement=sal_False,sal_Bool _aCaseSensitive=sal_False,sal_Bool _aSearchable=sal_True,sal_Bool _aCurrency=sal_False,sal_Bool _aSigned=sal_False,sal_Bool _aReadOnly=sal_True,sal_Bool _aWritable=sal_False,sal_Bool _aDefinitelyWritable=sal_False,const::rtl::OUString & _aColumnLabel=::rtl::OUString (),const::rtl::OUString & _aColumnTypeName=::rtl::OUString (),const::rtl::OUString & _aColumnServiceName=::rtl::OUString ())60         OColumn(const ::rtl::OUString &_aTableName,
61                 const ::rtl::OUString &_aColumnName,
62 
63                 sal_Int32       _aNullable=0,
64                 sal_Int32       _aColumnDisplaySize=0,
65                 sal_Int32       _aPrecision=0,
66                 sal_Int32       _aScale=0,
67                 sal_Int32       _aColumnType=0,
68 
69                 sal_Bool        _aAutoIncrement=sal_False,
70                 sal_Bool        _aCaseSensitive=sal_False,
71                 sal_Bool        _aSearchable=sal_True,
72                 sal_Bool        _aCurrency=sal_False,
73                 sal_Bool        _aSigned=sal_False,
74                 sal_Bool        _aReadOnly=sal_True,
75                 sal_Bool        _aWritable=sal_False,
76                 sal_Bool        _aDefinitelyWritable=sal_False,
77 
78                 const ::rtl::OUString &_aColumnLabel = ::rtl::OUString(),
79                 const ::rtl::OUString &_aColumnTypeName = ::rtl::OUString(),
80                 const ::rtl::OUString &_aColumnServiceName = ::rtl::OUString())
81         :   m_TableName(_aTableName),
82             m_ColumnName(_aColumnName),
83             m_ColumnLabel(_aColumnLabel),
84             m_ColumnTypeName(_aColumnTypeName),
85             m_ColumnServiceName(_aColumnServiceName),
86 
87             m_Nullable(_aNullable),
88             m_ColumnDisplaySize(_aColumnDisplaySize),
89             m_Precision(_aPrecision),
90             m_Scale(_aScale),
91             m_ColumnType(_aColumnType),
92 
93             m_AutoIncrement(_aAutoIncrement),
94             m_CaseSensitive(_aCaseSensitive),
95             m_Searchable(_aSearchable),
96             m_Currency(_aCurrency),
97             m_Signed(_aSigned),
98             m_ReadOnly(_aReadOnly),
99             m_Writable(_aWritable),
100             m_DefinitelyWritable(_aDefinitelyWritable)
101         {
102             if(!m_ColumnLabel.getLength())
103                 m_ColumnLabel = _aColumnName;
104         }
105 
operator new(size_t nSize)106         inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
107             { return ::rtl_allocateMemory( nSize ); }
operator new(size_t,void * _pHint)108         inline static void * SAL_CALL operator new( size_t ,void* _pHint ) SAL_THROW( () )
109             { return _pHint; }
operator delete(void * pMem)110         inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
111             { ::rtl_freeMemory( pMem ); }
operator delete(void *,void *)112         inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () )
113             {  }
114 
isAutoIncrement() const115         sal_Bool isAutoIncrement()              const { return m_AutoIncrement; }
isCaseSensitive() const116         sal_Bool isCaseSensitive()              const { return m_CaseSensitive; }
isSearchable() const117         sal_Bool isSearchable()                 const { return m_Searchable; }
isCurrency() const118         sal_Bool isCurrency()                   const { return m_Currency; }
isSigned() const119         sal_Bool isSigned()                     const { return m_Signed; }
isReadOnly() const120         sal_Bool isReadOnly()                   const { return m_ReadOnly; }
isWritable() const121         sal_Bool isWritable()                   const { return m_Writable; }
isDefinitelyWritable() const122         sal_Bool isDefinitelyWritable()         const { return m_DefinitelyWritable; }
123 
isNullable() const124         sal_Int32 isNullable()                  const { return m_Nullable; }
getColumnDisplaySize() const125         sal_Int32 getColumnDisplaySize()        const { return m_ColumnDisplaySize; }
getPrecision() const126         sal_Int32 getPrecision()                const { return m_Precision; }
getScale() const127         sal_Int32 getScale()                    const { return m_Scale; }
getColumnType() const128         sal_Int32 getColumnType()               const { return m_ColumnType; }
129 
getColumnLabel() const130         const ::rtl::OUString& getColumnLabel()         const { return m_ColumnLabel; }
getColumnName() const131         const ::rtl::OUString& getColumnName()          const { return m_ColumnName; }
getSchemaName() const132         const ::rtl::OUString& getSchemaName()          const { return m_SchemaName; }
getTableName() const133         const ::rtl::OUString& getTableName()           const { return m_TableName; }
getCatalogName() const134         const ::rtl::OUString& getCatalogName()         const { return m_CatalogName; }
getColumnTypeName() const135         const ::rtl::OUString& getColumnTypeName()      const { return m_ColumnTypeName; }
getColumnServiceName() const136         const ::rtl::OUString& getColumnServiceName()   const { return m_ColumnServiceName; }
137 
138     };
139 }
140 
141 #endif //_CONNECTIVITY_COLUMN_HXX_
142 
143