File indexing completed on 2025-01-18 10:04:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _OSD_CachedFileSystem_HeaderFile
0015 #define _OSD_CachedFileSystem_HeaderFile
0016
0017 #include <OSD_FileSystem.hxx>
0018
0019
0020
0021
0022
0023 class OSD_CachedFileSystem : public OSD_FileSystem
0024 {
0025 DEFINE_STANDARD_RTTIEXT(OSD_CachedFileSystem, OSD_FileSystem)
0026 public:
0027
0028
0029 Standard_EXPORT OSD_CachedFileSystem (const Handle(OSD_FileSystem)& theLinkedFileSystem = Handle(OSD_FileSystem)());
0030
0031
0032 const Handle(OSD_FileSystem)& LinkedFileSystem() const { return myLinkedFS; }
0033
0034
0035 void SetLinkedFileSystem (const Handle(OSD_FileSystem)& theLinkedFileSystem) { myLinkedFS = theLinkedFileSystem; }
0036
0037
0038 Standard_EXPORT virtual Standard_Boolean IsSupportedPath (const TCollection_AsciiString& theUrl) const Standard_OVERRIDE;
0039
0040
0041 Standard_EXPORT virtual Standard_Boolean IsOpenIStream (const std::shared_ptr<std::istream>& theStream) const Standard_OVERRIDE;
0042
0043
0044 Standard_EXPORT virtual Standard_Boolean IsOpenOStream (const std::shared_ptr<std::ostream>& theStream) const Standard_OVERRIDE;
0045
0046
0047 Standard_EXPORT virtual std::shared_ptr<std::istream> OpenIStream
0048 (const TCollection_AsciiString& theUrl,
0049 const std::ios_base::openmode theParams,
0050 const int64_t theOffset,
0051 const std::shared_ptr<std::istream>& theOldStream) Standard_OVERRIDE;
0052
0053
0054 Standard_EXPORT virtual std::shared_ptr<std::ostream> OpenOStream (const TCollection_AsciiString& theUrl,
0055 const std::ios_base::openmode theMode) Standard_OVERRIDE;
0056
0057
0058 Standard_EXPORT virtual std::shared_ptr<std::streambuf> OpenStreamBuffer
0059 (const TCollection_AsciiString& theUrl,
0060 const std::ios_base::openmode theMode,
0061 const int64_t theOffset = 0,
0062 int64_t* theOutBufSize = NULL) Standard_OVERRIDE;
0063
0064 protected:
0065
0066
0067 struct OSD_CachedStream
0068 {
0069 TCollection_AsciiString Url;
0070 std::shared_ptr<std::istream> Stream;
0071 std::shared_ptr<std::streambuf> StreamBuf;
0072
0073 void Reset()
0074 {
0075 Stream.reset();
0076 StreamBuf.reset();
0077 }
0078 };
0079
0080 protected:
0081
0082 OSD_CachedStream myStream;
0083 Handle(OSD_FileSystem) myLinkedFS;
0084
0085 };
0086
0087 #endif