LibreOffice Module ucb (master)  1
filrow.hxx
Go to the documentation of this file.
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 #pragma once
20 
21 #include <com/sun/star/sdbc/XRow.hpp>
22 #include <com/sun/star/script/XTypeConverter.hpp>
23 #include <cppuhelper/implbase.hxx>
24 
25 namespace fileaccess {
26 
27  class TaskManager;
28 
29  class XRow_impl: public cppu::WeakImplHelper<
30  css::sdbc::XRow >
31  {
32  public:
33  XRow_impl( TaskManager* pShell,const css::uno::Sequence< css::uno::Any >& aValueMap );
34  virtual ~XRow_impl() override;
35 
36  virtual sal_Bool SAL_CALL
37  wasNull() override;
38 
39  virtual OUString SAL_CALL
40  getString( sal_Int32 columnIndex ) override;
41 
42  virtual sal_Bool SAL_CALL
43  getBoolean( sal_Int32 columnIndex ) override;
44 
45  virtual sal_Int8 SAL_CALL
46  getByte( sal_Int32 columnIndex ) override;
47 
48  virtual sal_Int16 SAL_CALL
49  getShort( sal_Int32 columnIndex ) override;
50 
51  virtual sal_Int32 SAL_CALL
52  getInt( sal_Int32 columnIndex ) override;
53 
54  virtual sal_Int64 SAL_CALL
55  getLong( sal_Int32 columnIndex ) override;
56 
57  virtual float SAL_CALL
58  getFloat( sal_Int32 columnIndex ) override;
59 
60  virtual double SAL_CALL
61  getDouble(
62  sal_Int32 columnIndex ) override;
63 
64  virtual css::uno::Sequence< sal_Int8 > SAL_CALL
65  getBytes( sal_Int32 columnIndex ) override;
66 
67  virtual css::util::Date SAL_CALL
68  getDate( sal_Int32 columnIndex ) override;
69 
70  virtual css::util::Time SAL_CALL
71  getTime( sal_Int32 columnIndex ) override;
72 
73  virtual css::util::DateTime SAL_CALL
74  getTimestamp( sal_Int32 columnIndex ) override;
75 
76  virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
77  getBinaryStream( sal_Int32 columnIndex ) override;
78 
79  virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
80  getCharacterStream( sal_Int32 columnIndex ) override;
81 
82  virtual css::uno::Any SAL_CALL
83  getObject(
84  sal_Int32 columnIndex,
85  const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
86 
87  virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL
88  getRef( sal_Int32 columnIndex ) override;
89 
90  virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL
91  getBlob( sal_Int32 columnIndex ) override;
92 
93  virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL
94  getClob( sal_Int32 columnIndex ) override;
95 
96  virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL
97  getArray( sal_Int32 columnIndex ) override;
98 
99  private:
100  osl::Mutex m_aMutex;
101  css::uno::Sequence< css::uno::Any > m_aValueMap;
104  css::uno::Reference< css::script::XTypeConverter > m_xTypeConverter;
105 
106  bool isIndexOutOfBounds( sal_Int32 nIndex );
107  template<typename T>
108  T getValue(sal_Int32 columnIndex);
109  };
110 
111 } // end namespace fileaccess
112 
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::script::XTypeConverter > m_xTypeConverter
Definition: filrow.hxx:104
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
Definition: filrow.cxx:107
virtual ~XRow_impl() override
Definition: filrow.cxx:85
osl::Mutex m_aMutex
Definition: filrow.hxx:100
signed char sal_Int8
virtual sal_Bool SAL_CALL wasNull() override
Definition: filrow.cxx:91
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
Definition: filrow.cxx:260
css::uno::Sequence< css::uno::Any > m_aValueMap
Definition: filrow.hxx:101
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
Definition: filrow.cxx:163
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
Definition: filrow.cxx:209
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
Definition: filrow.cxx:251
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
Definition: filrow.cxx:181
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
Definition: filrow.cxx:136
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
Definition: filrow.cxx:229
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
Definition: filrow.cxx:126
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
Definition: filrow.cxx:270
TaskManager * m_pMyShell
Definition: filrow.hxx:103
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
Definition: filrow.cxx:117
unsigned char sal_Bool
XRow_impl(TaskManager *pShell, const css::uno::Sequence< css::uno::Any > &aValueMap)
Definition: filrow.cxx:78
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
Definition: filrow.cxx:190
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
Definition: filrow.cxx:219
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
Definition: filrow.cxx:242
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
Definition: filrow.cxx:199
bool isIndexOutOfBounds(sal_Int32 nIndex)
Definition: filrow.cxx:279
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
Definition: filrow.cxx:154
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
Definition: filrow.cxx:145
T getValue(sal_Int32 columnIndex)
Definition: filrow.cxx:285
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
Definition: filrow.cxx:98
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
Definition: filrow.cxx:172