27Clob::Clob(isc_db_handle* pDatabaseHandle,
28 isc_tr_handle* pTransactionHandle,
29 ISC_QUAD
const & aBlobID):
31 m_aBlob(new
connectivity::firebird::
Blob(pDatabaseHandle, pTransactionHandle, aBlobID)),
40 Clob_BASE::disposing();
54 bool bLastSegmRead =
false;
55 std::vector<char> aSegmentBytes;
58 bLastSegmRead =
m_aBlob->readOneSegment( aSegmentBytes );
59 OUString sSegment(aSegmentBytes.data(), aSegmentBytes.size(), RTL_TEXTENCODING_UTF8);
63 }
while( !bLastSegmRead );
73 throw lang::IllegalArgumentException(
"nPosition < 1", *
this, 0);
77 throw lang::IllegalArgumentException(
"nLength < 0", *
this, 0);
84 OUStringBuffer sSegmentBuffer;
85 std::vector<char> aSegmentBytes;
89 bool bLastRead =
m_aBlob->readOneSegment( aSegmentBytes );
91 OUString sSegment(aSegmentBytes.data(), aSegmentBytes.size(), RTL_TEXTENCODING_UTF8);
94 if (sSegment.getLength() < nPosition)
97 throw lang::IllegalArgumentException(
"nPosition out of range", *
this, 0);
98 nPosition -= sSegment.getLength();
104 const sal_Int32 nCharsToCopy = std::min<sal_Int32>(sSegment.getLength() - nPosition,
105 nLength - sSegmentBuffer.getLength());
106 sSegmentBuffer.append(sSegment.subView(nPosition, nCharsToCopy));
107 if (sSegmentBuffer.getLength() ==
nLength)
108 return sSegmentBuffer.makeStringAndClear();
110 assert(sSegmentBuffer.getLength() <
nLength);
113 throw lang::IllegalArgumentException(
"out of range", *
this, 0);
124 return m_aBlob->getBinaryStream();
virtual OUString SAL_CALL getSubString(sal_Int64 aPosition, sal_Int32 aLength) override
virtual sal_Int64 SAL_CALL positionOfClob(const ::css::uno::Reference< ::css::sdbc::XClob > &rPattern, sal_Int64 aStart) override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream() override
virtual sal_Int64 SAL_CALL length() override
virtual void SAL_CALL disposing() override
rtl::Reference< connectivity::firebird::Blob > m_aBlob
virtual sal_Int64 SAL_CALL position(const OUString &rPattern, sal_Int32 aStart) override
void checkDisposed(bool _bThrow)
::cppu::WeakComponentImplHelper< css::sdbc::XClob > Clob_BASE