Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / core / api / RowSetRow.hxx
blob22dee65b6b9a27bda8a74f111f585f04da681c82
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_CORE_API_ROWSETROW_HXX
20 #define INCLUDED_DBACCESS_SOURCE_CORE_API_ROWSETROW_HXX
22 #include <rtl/ref.hxx>
23 #include <connectivity/CommonTools.hxx>
24 #include "connectivity/FValue.hxx"
25 #include <comphelper/types.hxx>
26 #include <salhelper/simplereferenceobject.hxx>
28 namespace dbaccess
30 typedef connectivity::ORowVector< connectivity::ORowSetValue > ORowSetValueVector;
31 typedef ::rtl::Reference< ORowSetValueVector > ORowSetRow;
32 typedef ::std::vector< ORowSetRow > ORowSetMatrix;
34 class ORowSetOldRowHelper : public salhelper::SimpleReferenceObject
36 ORowSetRow m_aRow;
38 ORowSetOldRowHelper& operator=(const ORowSetOldRowHelper& _rRH) SAL_DELETED_FUNCTION;
39 ORowSetOldRowHelper(const ORowSetOldRowHelper& _rRh) SAL_DELETED_FUNCTION;
40 public:
41 ORowSetOldRowHelper(){}
42 ORowSetOldRowHelper(const ORowSetRow& _rRow)
43 : m_aRow(_rRow)
46 inline ORowSetRow getRow() const { return m_aRow; }
47 inline void clearRow() { m_aRow = NULL; }
48 inline void setRow(const ORowSetRow& _rRow) { m_aRow = _rRow; }
51 typedef ::rtl::Reference< ORowSetOldRowHelper > TORowSetOldRowHelperRef;
53 class ORowSetValueCompare
55 const ::com::sun::star::uno::Any& m_rAny;
56 public:
57 ORowSetValueCompare(const ::com::sun::star::uno::Any& _rAny) : m_rAny(_rAny){}
59 bool operator ()(const ORowSetRow& _rRH)
61 switch((_rRH->get())[0].getTypeKind())
63 case ::com::sun::star::sdbc::DataType::TINYINT:
64 case ::com::sun::star::sdbc::DataType::SMALLINT:
65 case ::com::sun::star::sdbc::DataType::INTEGER:
66 return comphelper::getINT32(m_rAny) == (sal_Int32)(_rRH->get())[0];
67 default:
69 ::com::sun::star::uno::Sequence<sal_Int8> aSeq;
70 m_rAny >>= aSeq;
71 return aSeq == (_rRH->get())[0];
77 #endif // INCLUDED_DBACCESS_SOURCE_CORE_API_ROWSETROW_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */