22#include <com/sun/star/script/CannotConvertException.hpp>
23#include <com/sun/star/script/Converter.hpp>
24#include <com/sun/star/sdbc/SQLException.hpp>
28using namespace css::uno;
30#if OSL_DEBUG_LEVEL > 0
31#define THROW_WHERE SAL_WHERE
38template<
class _type_ >
40 uno::Reference< script::XTypeConverter >& xConverter,
45 bool no_success = ! ( rValue >>= aReturn );
60 no_success = ! ( aConvertedValue >>= aReturn );
65 catch (
const lang::IllegalArgumentException&)
69 catch (
const script::CannotConvertException&)
78XRow_impl::XRow_impl(
TaskManager* pMyShell,
const uno::Sequence< uno::Any >& seq )
81 m_pMyShell( pMyShell )
99 sal_Int32 columnIndex )
102 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
103 return getValue<OUString>(columnIndex);
108 sal_Int32 columnIndex )
111 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
112 return getValue<bool>(columnIndex);
118 sal_Int32 columnIndex )
121 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
122 return getValue<sal_Int8>(columnIndex);
127 sal_Int32 columnIndex )
130 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
131 return getValue<sal_Int16>(columnIndex);
137 sal_Int32 columnIndex )
140 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
141 return getValue<sal_Int32>(columnIndex);
146 sal_Int32 columnIndex )
149 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
150 return getValue<sal_Int64>(columnIndex);
155 sal_Int32 columnIndex )
158 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
159 return getValue<float>(columnIndex);
164 sal_Int32 columnIndex )
167 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
168 return getValue<double>(columnIndex);
171uno::Sequence< sal_Int8 > SAL_CALL
173 sal_Int32 columnIndex )
176 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
177 return getValue<uno::Sequence< sal_Int8 >>(columnIndex);
182 sal_Int32 columnIndex )
185 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
186 return getValue<util::Date>(columnIndex);
191 sal_Int32 columnIndex )
194 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
195 return getValue<util::Time>(columnIndex);
198util::DateTime SAL_CALL
200 sal_Int32 columnIndex )
203 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
204 return getValue<util::DateTime>(columnIndex);
208uno::Reference< io::XInputStream > SAL_CALL
210 sal_Int32 columnIndex )
213 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
214 return getValue<uno::Reference< io::XInputStream >>(columnIndex);
218uno::Reference< io::XInputStream > SAL_CALL
220 sal_Int32 columnIndex )
223 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
224 return getValue<uno::Reference< io::XInputStream >>(columnIndex);
230 sal_Int32 columnIndex,
231 const uno::Reference< container::XNameAccess >& )
234 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
235 std::scoped_lock aGuard(
m_aMutex );
241uno::Reference< sdbc::XRef > SAL_CALL
243 sal_Int32 columnIndex )
246 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
247 return getValue<uno::Reference< sdbc::XRef >>(columnIndex);
250uno::Reference< sdbc::XBlob > SAL_CALL
252 sal_Int32 columnIndex )
255 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
256 return getValue<uno::Reference< sdbc::XBlob >>(columnIndex);
259uno::Reference< sdbc::XClob > SAL_CALL
261 sal_Int32 columnIndex )
264 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
265 return getValue<uno::Reference< sdbc::XClob >>(columnIndex);
269uno::Reference< sdbc::XArray > SAL_CALL
271 sal_Int32 columnIndex )
274 throw sdbc::SQLException(
THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0,
uno::Any() );
275 return getValue<uno::Reference< sdbc::XArray >>(columnIndex);
288 std::scoped_lock aGuard(
m_aMutex );
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
css::uno::Sequence< css::uno::Any > m_aValueMap
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
bool isIndexOutOfBounds(sal_Int32 nIndex) const
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
css::uno::Reference< css::script::XTypeConverter > m_xTypeConverter
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
T getValue(sal_Int32 columnIndex)
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
virtual ~XRow_impl() override
virtual sal_Bool SAL_CALL wasNull() override
Reference< XTypeConverter > xConverter
static bool convert(TaskManager const *pShell, uno::Reference< script::XTypeConverter > &xConverter, const uno::Any &rValue, _type_ &aReturn)