1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
31 #include <osl/mutex.hxx>
32 #include <rtl/ustring.hxx>
33 #include <cppuhelper/weak.hxx>
34 #include <ucbhelper/macros.hxx>
35 #include <com/sun/star/uno/XInterface.hpp>
36 #include <com/sun/star/lang/XTypeProvider.hpp>
37 #include <com/sun/star/io/XSeekable.hpp>
38 #include <com/sun/star/io/XTruncate.hpp>
39 #include <com/sun/star/io/XInputStream.hpp>
40 #include <com/sun/star/io/XOutputStream.hpp>
41 #include <com/sun/star/io/XStream.hpp>
42 #include "com/sun/star/io/XAsyncOutputMonitor.hpp"
43 #include <com/sun/star/ucb/XContentProvider.hpp>
47 namespace fileaccess
{
51 class XInputStreamForStream
;
52 class XOutputStreamForStream
;
55 : public cppu::OWeakObject
,
56 public com::sun::star::lang::XTypeProvider
,
57 public com::sun::star::io::XStream
,
58 public com::sun::star::io::XSeekable
,
59 public com::sun::star::io::XInputStream
,
60 public com::sun::star::io::XOutputStream
,
61 public com::sun::star::io::XTruncate
,
62 public com::sun::star::io::XAsyncOutputMonitor
64 friend class XInputStreamForStream
;
65 friend class XOutputStreamForStream
;
69 XStream_impl( shell
* pMyShell
,const rtl::OUString
& aUncPath
, sal_Bool bLock
);
72 * Returns an error code as given by filerror.hxx
75 sal_Int32 SAL_CALL
CtorSuccess();
76 sal_Int32 SAL_CALL
getMinorError();
78 virtual ~XStream_impl();
83 virtual com::sun::star::uno::Any SAL_CALL
85 const com::sun::star::uno::Type
& rType
)
86 throw( com::sun::star::uno::RuntimeException
);
106 virtual com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
> SAL_CALL
108 throw( com::sun::star::uno::RuntimeException
);
110 virtual com::sun::star::uno::Reference
< com::sun::star::io::XOutputStream
> SAL_CALL
112 throw( com::sun::star::uno::RuntimeException
);
117 virtual void SAL_CALL
truncate( void )
118 throw( com::sun::star::io::IOException
,
119 com::sun::star::uno::RuntimeException
);
126 com::sun::star::uno::Sequence
< sal_Int8
>& aData
,
127 sal_Int32 nBytesToRead
)
128 throw( com::sun::star::io::NotConnectedException
,
129 com::sun::star::io::BufferSizeExceededException
,
130 com::sun::star::io::IOException
,
131 com::sun::star::uno::RuntimeException
);
135 com::sun::star::uno::Sequence
< sal_Int8
>& aData
,
136 sal_Int32 nMaxBytesToRead
)
137 throw( com::sun::star::io::NotConnectedException
,
138 com::sun::star::io::BufferSizeExceededException
,
139 com::sun::star::io::IOException
,
140 com::sun::star::uno::RuntimeException
);
145 sal_Int32 nBytesToSkip
)
146 throw( com::sun::star::io::NotConnectedException
,
147 com::sun::star::io::BufferSizeExceededException
,
148 com::sun::star::io::IOException
,
149 com::sun::star::uno::RuntimeException
);
154 throw( com::sun::star::io::NotConnectedException
,
155 com::sun::star::io::IOException
,
156 com::sun::star::uno::RuntimeException
);
161 throw( com::sun::star::io::NotConnectedException
,
162 com::sun::star::io::IOException
,
163 com::sun::star::uno::RuntimeException
);
170 throw( com::sun::star::lang::IllegalArgumentException
,
171 com::sun::star::io::IOException
,
172 com::sun::star::uno::RuntimeException
);
177 throw( com::sun::star::io::IOException
,
178 com::sun::star::uno::RuntimeException
);
183 throw( com::sun::star::io::IOException
,
184 com::sun::star::uno::RuntimeException
);
190 writeBytes( const com::sun::star::uno::Sequence
< sal_Int8
>& aData
)
191 throw( com::sun::star::io::NotConnectedException
,
192 com::sun::star::io::BufferSizeExceededException
,
193 com::sun::star::io::IOException
,
194 com::sun::star::uno::RuntimeException
);
200 throw( com::sun::star::io::NotConnectedException
,
201 com::sun::star::io::BufferSizeExceededException
,
202 com::sun::star::io::IOException
,
203 com::sun::star::uno::RuntimeException
);
209 throw( com::sun::star::io::NotConnectedException
,
210 com::sun::star::io::IOException
,
211 com::sun::star::uno::RuntimeException
);
213 virtual void SAL_CALL
waitForCompletion()
215 com::sun::star::io::IOException
,
216 com::sun::star::uno::RuntimeException
);
221 bool m_bInputStreamCalled
,m_bOutputStreamCalled
;
224 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentProvider
> m_xProvider
;
229 ReconnectingFile m_aFile
;
231 sal_Int32 m_nErrorCode
;
232 sal_Int32 m_nMinorErrorCode
;
234 // Implementation methods
239 throw( com::sun::star::io::NotConnectedException
,
240 com::sun::star::io::IOException
,
241 com::sun::star::uno::RuntimeException
);
245 } // end namespace XStream_impl
249 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */