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/.
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_CONNECTIVITY_SOURCE_INC_ODBC_OBOUNDPARAM_HXX
20 #define INCLUDED_CONNECTIVITY_SOURCE_INC_ODBC_OBOUNDPARAM_HXX
22 #include <com/sun/star/io/XInputStream.hpp>
23 #include <com/sun/star/sdbc/DataType.hpp>
24 #include <odbc/odbcbasedllapi.hxx>
25 #include <connectivity/odbc.hxx>
27 namespace connectivity::odbc
29 class OOO_DLLPUBLIC_ODBCBASE OBoundParam
36 , paramInputStreamLen(0)
44 // allocBindDataBuffer
45 // Allocates and returns a new bind data buffer of the specified
48 void* allocBindDataBuffer (sal_Int32 bufLen
)
50 // Reset the input stream and sequence, we are doing a new bind
51 setInputStream (nullptr, 0);
55 binaryData
= (bufLen
> 0) ? malloc(bufLen
) : nullptr;
61 // getBindLengthBuffer
62 // Returns the length buffer to be used when binding to a parameter
64 SQLLEN
& getBindLengthBuffer ()
71 // Sets the input stream for the bound parameter
73 void setInputStream(const css::uno::Reference
< css::io::XInputStream
>& inputStream
,
76 paramInputStream
= inputStream
;
77 paramInputStreamLen
= len
;
80 void setSequence(const css::uno::Sequence
< sal_Int8
>& _aSequence
)
82 aSequence
= _aSequence
;
87 // Gets the input stream for the bound parameter
89 const css::uno::Reference
< css::io::XInputStream
>& getInputStream () const
91 return paramInputStream
;
96 // Gets the input stream length for the bound parameter
98 sal_Int32
getInputStreamLen () const
100 return paramInputStreamLen
;
109 void *binaryData
; // Storage area to be used
110 // when binding the parameter
112 SQLLEN paramLength
; // Storage area to be used
113 // for the bound length of the
114 // parameter. Note that this
115 // data is in native format.
117 css::uno::Reference
< css::io::XInputStream
> paramInputStream
;
118 css::uno::Sequence
< sal_Int8
> aSequence
;
119 // When an input stream is
120 // bound to a parameter, a
121 // reference to the input stream is saved
122 // until not needed anymore.
124 sal_Int32 paramInputStreamLen
; // Length of input stream
128 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ODBC_OBOUNDPARAM_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */