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 #ifndef INCLUDED_UCB_SOURCE_UCP_FILE_FILROW_HXX
20 #define INCLUDED_UCB_SOURCE_UCP_FILE_FILROW_HXX
21 
22 #include <com/sun/star/sdbc/XRow.hpp>
23 #include <com/sun/star/script/XTypeConverter.hpp>
24 #include <com/sun/star/ucb/XContentProvider.hpp>
25 #include <cppuhelper/implbase.hxx>
26 
27 namespace fileaccess {
28 
29  class TaskManager;
30 
31  class XRow_impl: public cppu::WeakImplHelper<
32  css::sdbc::XRow >
33  {
34  public:
35  XRow_impl( TaskManager* pShell,const css::uno::Sequence< css::uno::Any >& aValueMap );
36  virtual ~XRow_impl() override;
37 
38  virtual sal_Bool SAL_CALL
39  wasNull() override;
40 
41  virtual OUString SAL_CALL
42  getString( sal_Int32 columnIndex ) override;
43 
44  virtual sal_Bool SAL_CALL
45  getBoolean( sal_Int32 columnIndex ) override;
46 
47  virtual sal_Int8 SAL_CALL
48  getByte( sal_Int32 columnIndex ) override;
49 
50  virtual sal_Int16 SAL_CALL
51  getShort( sal_Int32 columnIndex ) override;
52 
53  virtual sal_Int32 SAL_CALL
54  getInt( sal_Int32 columnIndex ) override;
55 
56  virtual sal_Int64 SAL_CALL
57  getLong( sal_Int32 columnIndex ) override;
58 
59  virtual float SAL_CALL
60  getFloat( sal_Int32 columnIndex ) override;
61 
62  virtual double SAL_CALL
63  getDouble(
64  sal_Int32 columnIndex ) override;
65 
66  virtual css::uno::Sequence< sal_Int8 > SAL_CALL
67  getBytes( sal_Int32 columnIndex ) override;
68 
69  virtual css::util::Date SAL_CALL
70  getDate( sal_Int32 columnIndex ) override;
71 
72  virtual css::util::Time SAL_CALL
73  getTime( sal_Int32 columnIndex ) override;
74 
75  virtual css::util::DateTime SAL_CALL
76  getTimestamp( sal_Int32 columnIndex ) override;
77 
78  virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
79  getBinaryStream( sal_Int32 columnIndex ) override;
80 
81  virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
82  getCharacterStream( sal_Int32 columnIndex ) override;
83 
84  virtual css::uno::Any SAL_CALL
85  getObject(
86  sal_Int32 columnIndex,
87  const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
88 
89  virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL
90  getRef( sal_Int32 columnIndex ) override;
91 
92  virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL
93  getBlob( sal_Int32 columnIndex ) override;
94 
95  virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL
96  getClob( sal_Int32 columnIndex ) override;
97 
98  virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL
99  getArray( sal_Int32 columnIndex ) override;
100 
101  private:
102  osl::Mutex m_aMutex;
103  css::uno::Sequence< css::uno::Any > m_aValueMap;
106  css::uno::Reference< css::script::XTypeConverter > m_xTypeConverter;
107 
108  bool isIndexOutOfBounds( sal_Int32 nIndex );
109  template<typename T>
110  T getValue(sal_Int32 columnIndex);
111  };
112 
113 } // end namespace fileaccess
114 
115 #endif
116 
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::script::XTypeConverter > m_xTypeConverter
Definition: filrow.hxx:106
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
Definition: filrow.cxx:110
virtual ~XRow_impl() override
Definition: filrow.cxx:88
osl::Mutex m_aMutex
Definition: filrow.hxx:102
signed char sal_Int8
virtual sal_Bool SAL_CALL wasNull() override
Definition: filrow.cxx:94
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
Definition: filrow.cxx:263
css::uno::Sequence< css::uno::Any > m_aValueMap
Definition: filrow.hxx:103
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
Definition: filrow.cxx:166
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
Definition: filrow.cxx:212
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
Definition: filrow.cxx:254
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
Definition: filrow.cxx:184
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
Definition: filrow.cxx:139
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
Definition: filrow.cxx:232
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
Definition: filrow.cxx:129
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
Definition: filrow.cxx:273
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
Definition: filrow.cxx:120
unsigned char sal_Bool
XRow_impl(TaskManager *pShell, const css::uno::Sequence< css::uno::Any > &aValueMap)
Definition: filrow.cxx:81
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
Definition: filrow.cxx:193
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
Definition: filrow.cxx:222
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
Definition: filrow.cxx:245
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
Definition: filrow.cxx:202
bool isIndexOutOfBounds(sal_Int32 nIndex)
Definition: filrow.cxx:282
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
Definition: filrow.cxx:157
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
Definition: filrow.cxx:148
T getValue(sal_Int32 columnIndex)
Definition: filrow.cxx:288
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
Definition: filrow.cxx:101
TaskManager *const m_pMyShell
Definition: filrow.hxx:105
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
Definition: filrow.cxx:175