0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
[occt.git] / src / OSD / OSD_LocalFileSystem.hxx
1 // Copyright (c) 2021 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _OSD_LocalFileSystem_HeaderFile
15 #define _OSD_LocalFileSystem_HeaderFile
16
17 #include <OSD_FileSystem.hxx>
18
19 //! A file system opening local files (or files from mount systems).
20 class OSD_LocalFileSystem : public OSD_FileSystem
21 {
22   DEFINE_STANDARD_RTTIEXT(OSD_LocalFileSystem, OSD_FileSystem)
23 public:
24
25   //! Constructor.
26   OSD_LocalFileSystem() {}
27
28   //! Returns TRUE if URL defines a supported protocol.
29   Standard_EXPORT virtual Standard_Boolean IsSupportedPath (const TCollection_AsciiString& theUrl) const Standard_OVERRIDE;
30
31   //! Returns TRUE if current input stream is opened for reading operations.
32   Standard_EXPORT virtual Standard_Boolean IsOpenIStream (const opencascade::std::shared_ptr<std::istream>& theStream) const Standard_OVERRIDE;
33
34   //! Returns TRUE if current output stream is opened for writing operations.
35   Standard_EXPORT virtual Standard_Boolean IsOpenOStream (const opencascade::std::shared_ptr<std::ostream>& theStream) const Standard_OVERRIDE;
36
37   //! Opens stream buffer for specified file URL.
38   Standard_EXPORT virtual opencascade::std::shared_ptr<std::streambuf> OpenStreamBuffer
39                           (const TCollection_AsciiString& theUrl,
40                            const std::ios_base::openmode theMode,
41                            const int64_t theOffset = 0,
42                            int64_t* theOutBufSize = NULL) Standard_OVERRIDE;
43 };
44 #endif // _OSD_LocalFileSystem_HeaderFile