diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-11-24 14:36:20 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-11-24 23:14:54 +0100 |
commit | 79c1b05591a66fb3c7cec60bc3ad91382095a936 (patch) | |
tree | 71b68994da5075bef95cc21ce60f03a7f209bfb3 /svl | |
parent | 09186fceb0ca5ab67cc81ed601fd0e25d49a03ad (diff) |
Remove not used SvLockBytesInputStream
Change-Id: Id4e0852f6d204b3a1d2a7f5ce281730f5fcad8fd
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/misc/strmadpt.cxx | 179 |
1 files changed, 3 insertions, 176 deletions
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index 43923f1a2797..a651eaaed8bc 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -25,6 +25,9 @@ #include <set> #include <string.h> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XSeekable.hpp> + #include <osl/diagnose.h> #include <rtl/alloc.h> #include <cppuhelper/queryinterface.hxx> @@ -235,182 +238,6 @@ void SvOutputStreamOpenLockBytes::Terminate() } -// SvLockBytesInputStream - - -// virtual -uno::Any SAL_CALL SvLockBytesInputStream::queryInterface(uno::Type const & - rType) - throw (uno::RuntimeException, std::exception) -{ - uno::Any - aReturn(cppu::queryInterface(rType, - static_cast< io::XInputStream * >(this), - static_cast< io::XSeekable * >(this))); - return aReturn.hasValue() ? aReturn : OWeakObject::queryInterface(rType); -} - -// virtual -void SAL_CALL SvLockBytesInputStream::acquire() throw () -{ - OWeakObject::acquire(); -} - -// virtual -void SAL_CALL SvLockBytesInputStream::release() throw () -{ - OWeakObject::release(); -} - -// virtual -sal_Int32 SAL_CALL -SvLockBytesInputStream::readBytes(uno::Sequence< sal_Int8 > & rData, - sal_Int32 nBytesToRead) - throw (io::IOException, uno::RuntimeException, std::exception) -{ - OSL_ASSERT(m_nPosition >= 0); - if (!m_xLockBytes.Is()) - throw io::NotConnectedException(); - if ( - nBytesToRead < 0 || - ( - static_cast<sal_uInt64>(m_nPosition) > SAL_MAX_SIZE && - nBytesToRead > 0 - ) - ) - { - throw io::IOException(); - } - rData.realloc(nBytesToRead); - sal_Int32 nSize = 0; - while (nSize < nBytesToRead) - { - sal_Size nCount; - ErrCode nError = m_xLockBytes->ReadAt(m_nPosition, - rData.getArray() + nSize, - nBytesToRead - nSize, &nCount); - if (nError != ERRCODE_NONE && nError != ERRCODE_IO_PENDING) - throw io::IOException(); - m_nPosition += nCount; - nSize += nCount; - if (nError == ERRCODE_NONE && nCount == 0) - break; - } - rData.realloc(nSize); - return nSize; -} - -// virtual -sal_Int32 SAL_CALL -SvLockBytesInputStream::readSomeBytes(uno::Sequence< sal_Int8 > & rData, - sal_Int32 nMaxBytesToRead) - throw (io::IOException, uno::RuntimeException, std::exception) -{ - OSL_ASSERT(m_nPosition >= 0); - if (!m_xLockBytes.Is()) - throw io::NotConnectedException(); - if (static_cast<sal_uInt64>(m_nPosition) > SAL_MAX_SIZE - && nMaxBytesToRead > 0) - throw io::IOException(); - rData.realloc(nMaxBytesToRead); - sal_Size nCount = 0; - if (nMaxBytesToRead > 0) - { - ErrCode nError; - do - { - nError = m_xLockBytes->ReadAt(m_nPosition, - rData.getArray(), - nMaxBytesToRead, - &nCount); - if (nError != ERRCODE_NONE && nError != ERRCODE_IO_PENDING) - throw io::IOException(); - m_nPosition += nCount; - } - while (nCount == 0 && nError == ERRCODE_IO_PENDING); - } - rData.realloc(sal_Int32(nCount)); - return sal_Int32(nCount); -} - -// virtual -void SAL_CALL SvLockBytesInputStream::skipBytes(sal_Int32 nBytesToSkip) - throw (io::IOException, uno::RuntimeException, std::exception) -{ - if (!m_xLockBytes.Is()) - throw io::NotConnectedException(); - if (nBytesToSkip < 0) - throw io::IOException(); - if (nBytesToSkip > SAL_MAX_INT64 - m_nPosition) - throw io::BufferSizeExceededException(); - m_nPosition += nBytesToSkip; -} - -// virtual -sal_Int32 SAL_CALL SvLockBytesInputStream::available() - throw (io::IOException, uno::RuntimeException, std::exception) -{ - OSL_ASSERT(m_nPosition >= 0); - if (!m_xLockBytes.Is()) - throw io::NotConnectedException(); - SvLockBytesStat aStat; - if (m_xLockBytes->Stat(&aStat, SVSTATFLAG_DEFAULT) != ERRCODE_NONE) - throw io::IOException(); - return aStat.nSize <= static_cast<sal_uInt64>(m_nPosition) ? - 0 : - static_cast<sal_Size>(aStat.nSize - m_nPosition) <= - static_cast<sal_uInt32>(SAL_MAX_INT32) ? - static_cast<sal_Int32>(aStat.nSize - m_nPosition) : - SAL_MAX_INT32; -} - -// virtual -void SAL_CALL SvLockBytesInputStream::closeInput() - throw (io::IOException, uno::RuntimeException, std::exception) -{ - if (!m_xLockBytes.Is()) - throw io::NotConnectedException(); - m_xLockBytes = 0; -} - -// virtual -void SAL_CALL SvLockBytesInputStream::seek(sal_Int64 nLocation) - throw (lang::IllegalArgumentException, io::IOException, - uno::RuntimeException, std::exception) -{ - if (nLocation < 0) - throw lang::IllegalArgumentException(); - if (!m_xLockBytes.Is()) - throw io::NotConnectedException(); - m_nPosition = nLocation; -} - -// virtual -sal_Int64 SAL_CALL SvLockBytesInputStream::getPosition() - throw (io::IOException, uno::RuntimeException, std::exception) -{ - if (!m_xLockBytes.Is()) - throw io::NotConnectedException(); - return m_nPosition; -} - -// virtual -sal_Int64 SAL_CALL SvLockBytesInputStream::getLength() - throw (io::IOException, uno::RuntimeException, std::exception) -{ - if (!m_xLockBytes.Is()) - throw io::NotConnectedException(); - SvLockBytesStat aStat; - if (m_xLockBytes->Stat(&aStat, SVSTATFLAG_DEFAULT) != ERRCODE_NONE) - throw io::IOException(); -#if SAL_TYPES_SIZEOFPOINTER > 4 // avoid warnings if sal_Size < sal_Int64 - if (aStat.nSize > static_cast<sal_uInt64>(SAL_MAX_INT64)) - throw io::IOException(); -#endif - return aStat.nSize; -} - - // SvInputStream |