Coverage Report

Created: 2026-06-30 11:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/connectivity/source/inc/OColumn.hxx
Line
Count
Source
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
#pragma once
21
22
#include <rtl/ustring.hxx>
23
#include <sal/types.h>
24
#include <connectivity/dbtoolsdllapi.hxx>
25
#include <utility>
26
27
namespace connectivity
28
{
29
    class OOO_DLLPUBLIC_DBTOOLS OColumn
30
    {
31
        OUString m_TableName;
32
        OUString m_ColumnName;
33
        OUString m_ColumnLabel;
34
35
        sal_Int32       m_Nullable;
36
        sal_Int32       m_ColumnDisplaySize;
37
        sal_Int32       m_Precision;
38
        sal_Int32       m_Scale;
39
        sal_Int32       m_ColumnType;
40
41
        bool        m_AutoIncrement;
42
        bool        m_CaseSensitive;
43
        bool        m_Searchable;
44
        bool        m_Currency;
45
        bool        m_Signed;
46
        bool        m_ReadOnly;
47
        bool        m_Writable;
48
        bool        m_DefinitelyWritable;
49
50
    public:
51
        OColumn()
52
691k
            : m_Nullable(0)
53
691k
            , m_ColumnDisplaySize(0)
54
691k
            , m_Precision(0)
55
691k
            , m_Scale(0)
56
691k
            , m_ColumnType(0)
57
58
691k
            , m_AutoIncrement(false)
59
691k
            , m_CaseSensitive(false)
60
691k
            , m_Searchable(true)
61
691k
            , m_Currency(false)
62
691k
            , m_Signed(false)
63
691k
            , m_ReadOnly(true)
64
691k
            , m_Writable(false)
65
691k
            , m_DefinitelyWritable(false)
66
691k
            {}
67
68
        OColumn(OUString _aTableName,
69
                const OUString &_aColumnName,
70
                sal_Int32       _aNullable,
71
                sal_Int32       _aColumnDisplaySize,
72
                sal_Int32       _aPrecision,
73
                sal_Int32       _aScale,
74
                sal_Int32       _aColumnType)
75
691k
        :   m_TableName(std::move(_aTableName)),
76
691k
            m_ColumnName(_aColumnName),
77
691k
            m_ColumnLabel(),
78
79
691k
            m_Nullable(_aNullable),
80
691k
            m_ColumnDisplaySize(_aColumnDisplaySize),
81
691k
            m_Precision(_aPrecision),
82
691k
            m_Scale(_aScale),
83
691k
            m_ColumnType(_aColumnType),
84
85
691k
            m_AutoIncrement(false),
86
691k
            m_CaseSensitive(false),
87
691k
            m_Searchable(true),
88
691k
            m_Currency(false),
89
691k
            m_Signed(false),
90
691k
            m_ReadOnly(true),
91
691k
            m_Writable(false),
92
691k
            m_DefinitelyWritable(false)
93
691k
        {
94
691k
            if(m_ColumnLabel.isEmpty())
95
691k
                m_ColumnLabel = _aColumnName;
96
691k
        }
97
98
0
        bool isAutoIncrement()              const { return m_AutoIncrement; }
99
0
        bool isCaseSensitive()              const { return m_CaseSensitive; }
100
0
        bool isSearchable()                 const { return m_Searchable; }
101
0
        bool isCurrency()                   const { return m_Currency; }
102
0
        bool isSigned()                     const { return m_Signed; }
103
0
        bool isReadOnly()                   const { return m_ReadOnly; }
104
0
        bool isWritable()                   const { return m_Writable; }
105
0
        bool isDefinitelyWritable()         const { return m_DefinitelyWritable; }
106
107
0
        sal_Int32 isNullable()                  const { return m_Nullable; }
108
0
        sal_Int32 getColumnDisplaySize()        const { return m_ColumnDisplaySize; }
109
0
        sal_Int32 getPrecision()                const { return m_Precision; }
110
0
        sal_Int32 getScale()                    const { return m_Scale; }
111
0
        sal_Int32 getColumnType()               const { return m_ColumnType; }
112
113
0
        const OUString& getColumnLabel()         const { return m_ColumnLabel; }
114
0
        const OUString& getColumnName()          const { return m_ColumnName; }
115
0
        const OUString& getTableName()           const { return m_TableName; }
116
    };
117
}
118
119
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */