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 .
22 #include <osl/mutex.hxx>
23 #include <rtl/ustring.hxx>
24 #include <cppuhelper/weak.hxx>
25 #include <ucbhelper/macros.hxx>
26 #include <com/sun/star/uno/XInterface.hpp>
27 #include <com/sun/star/lang/XTypeProvider.hpp>
28 #include <com/sun/star/io/XSeekable.hpp>
29 #include <com/sun/star/io/XTruncate.hpp>
30 #include <com/sun/star/io/XInputStream.hpp>
31 #include <com/sun/star/io/XOutputStream.hpp>
32 #include <com/sun/star/io/XStream.hpp>
33 #include "com/sun/star/io/XAsyncOutputMonitor.hpp"
34 #include <com/sun/star/ucb/XContentProvider.hpp>
38 namespace fileaccess
{
44 : public cppu::OWeakObject
,
45 public com::sun::star::lang::XTypeProvider
,
46 public com::sun::star::io::XStream
,
47 public com::sun::star::io::XSeekable
,
48 public com::sun::star::io::XInputStream
,
49 public com::sun::star::io::XOutputStream
,
50 public com::sun::star::io::XTruncate
,
51 public com::sun::star::io::XAsyncOutputMonitor
56 XStream_impl( shell
* pMyShell
,const rtl::OUString
& aUncPath
, sal_Bool bLock
);
59 * Returns an error code as given by filerror.hxx
62 sal_Int32 SAL_CALL
CtorSuccess();
63 sal_Int32 SAL_CALL
getMinorError();
65 virtual ~XStream_impl();
70 virtual com::sun::star::uno::Any SAL_CALL
72 const com::sun::star::uno::Type
& rType
)
73 throw( com::sun::star::uno::RuntimeException
);
93 virtual com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
> SAL_CALL
95 throw( com::sun::star::uno::RuntimeException
);
97 virtual com::sun::star::uno::Reference
< com::sun::star::io::XOutputStream
> SAL_CALL
99 throw( com::sun::star::uno::RuntimeException
);
104 virtual void SAL_CALL
truncate( void )
105 throw( com::sun::star::io::IOException
,
106 com::sun::star::uno::RuntimeException
);
113 com::sun::star::uno::Sequence
< sal_Int8
>& aData
,
114 sal_Int32 nBytesToRead
)
115 throw( com::sun::star::io::NotConnectedException
,
116 com::sun::star::io::BufferSizeExceededException
,
117 com::sun::star::io::IOException
,
118 com::sun::star::uno::RuntimeException
);
122 com::sun::star::uno::Sequence
< sal_Int8
>& aData
,
123 sal_Int32 nMaxBytesToRead
)
124 throw( com::sun::star::io::NotConnectedException
,
125 com::sun::star::io::BufferSizeExceededException
,
126 com::sun::star::io::IOException
,
127 com::sun::star::uno::RuntimeException
);
132 sal_Int32 nBytesToSkip
)
133 throw( com::sun::star::io::NotConnectedException
,
134 com::sun::star::io::BufferSizeExceededException
,
135 com::sun::star::io::IOException
,
136 com::sun::star::uno::RuntimeException
);
141 throw( com::sun::star::io::NotConnectedException
,
142 com::sun::star::io::IOException
,
143 com::sun::star::uno::RuntimeException
);
148 throw( com::sun::star::io::NotConnectedException
,
149 com::sun::star::io::IOException
,
150 com::sun::star::uno::RuntimeException
);
157 throw( com::sun::star::lang::IllegalArgumentException
,
158 com::sun::star::io::IOException
,
159 com::sun::star::uno::RuntimeException
);
164 throw( com::sun::star::io::IOException
,
165 com::sun::star::uno::RuntimeException
);
170 throw( com::sun::star::io::IOException
,
171 com::sun::star::uno::RuntimeException
);
177 writeBytes( const com::sun::star::uno::Sequence
< sal_Int8
>& aData
)
178 throw( com::sun::star::io::NotConnectedException
,
179 com::sun::star::io::BufferSizeExceededException
,
180 com::sun::star::io::IOException
,
181 com::sun::star::uno::RuntimeException
);
187 throw( com::sun::star::io::NotConnectedException
,
188 com::sun::star::io::BufferSizeExceededException
,
189 com::sun::star::io::IOException
,
190 com::sun::star::uno::RuntimeException
);
196 throw( com::sun::star::io::NotConnectedException
,
197 com::sun::star::io::IOException
,
198 com::sun::star::uno::RuntimeException
);
200 virtual void SAL_CALL
waitForCompletion()
202 com::sun::star::io::IOException
,
203 com::sun::star::uno::RuntimeException
);
208 bool m_bInputStreamCalled
,m_bOutputStreamCalled
;
211 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentProvider
> m_xProvider
;
214 ReconnectingFile m_aFile
;
216 sal_Int32 m_nErrorCode
;
217 sal_Int32 m_nMinorErrorCode
;
219 // Implementation methods
224 throw( com::sun::star::io::NotConnectedException
,
225 com::sun::star::io::IOException
,
226 com::sun::star::uno::RuntimeException
);
230 } // end namespace XStream_impl
234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */