1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_BLOB_HXX
11 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_BLOB_HXX
15 #include <cppuhelper/compbase2.hxx>
17 #include <com/sun/star/io/XInputStream.hpp>
18 #include <com/sun/star/sdbc/XBlob.hpp>
20 namespace connectivity
24 typedef ::cppu::WeakComponentImplHelper2
< ::com::sun::star::sdbc::XBlob
,
25 ::com::sun::star::io::XInputStream
>
32 ::osl::Mutex m_aMutex
;
34 isc_db_handle
* m_pDatabaseHandle
;
35 isc_tr_handle
* m_pTransactionHandle
;
36 // We store our own copy of the blob id as typically the statement
37 // manages it's own blob id, and blobs are independent of a statement
40 isc_blob_handle m_blobHandle
;
43 sal_Int64 m_nBlobLength
;
44 sal_Int64 m_nBlobPosition
;
46 ISC_STATUS_ARRAY m_statusVector
;
48 void ensureBlobIsOpened()
49 throw(::com::sun::star::sdbc::SQLException
);
51 * Closes the blob and cleans up resources -- can be used to reset
52 * the blob if we e.g. want to read from the beginning again.
55 throw(::com::sun::star::sdbc::SQLException
);
58 Blob(isc_db_handle
* pDatabaseHandle
,
59 isc_tr_handle
* pTransactionHandle
,
62 // ---- XBlob ----------------------------------------------------
63 virtual sal_Int64 SAL_CALL
65 throw(::com::sun::star::sdbc::SQLException
,
66 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
67 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
68 getBytes(sal_Int64 aPosition
, sal_Int32 aLength
)
69 throw(::com::sun::star::sdbc::SQLException
,
70 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
71 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> SAL_CALL
73 throw(::com::sun::star::sdbc::SQLException
,
74 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
75 virtual sal_Int64 SAL_CALL
76 position(const ::com::sun::star::uno::Sequence
< sal_Int8
>& rPattern
,
78 throw(::com::sun::star::sdbc::SQLException
,
79 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual sal_Int64 SAL_CALL
81 positionOfBlob(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XBlob
>& rPattern
,
83 throw(::com::sun::star::sdbc::SQLException
,
84 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 // ---- XInputStream ----------------------------------------------
87 virtual sal_Int32 SAL_CALL
88 readBytes(::com::sun::star::uno::Sequence
< sal_Int8
>& rDataOut
,
90 throw(::com::sun::star::io::NotConnectedException
,
91 ::com::sun::star::io::BufferSizeExceededException
,
92 ::com::sun::star::io::IOException
,
93 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
94 virtual sal_Int32 SAL_CALL
95 readSomeBytes(::com::sun::star::uno::Sequence
< sal_Int8
>& rDataOut
,
96 sal_Int32 nMaximumBytes
)
97 throw(::com::sun::star::io::NotConnectedException
,
98 ::com::sun::star::io::BufferSizeExceededException
,
99 ::com::sun::star::io::IOException
,
100 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 virtual void SAL_CALL
102 skipBytes(sal_Int32 nBytes
)
103 throw(::com::sun::star::io::NotConnectedException
,
104 ::com::sun::star::io::BufferSizeExceededException
,
105 ::com::sun::star::io::IOException
,
106 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 virtual sal_Int32 SAL_CALL
109 throw(::com::sun::star::io::NotConnectedException
,
110 ::com::sun::star::io::IOException
,
111 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 virtual void SAL_CALL
114 throw(::com::sun::star::io::NotConnectedException
,
115 ::com::sun::star::io::IOException
,
116 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 // ---- OComponentHelper ------------------------------------------
119 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
125 #endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_BLOB_HXX
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */