Vault
4.1
|
00001 /* 00002 Copyright c1997-2014 Trygve Isaacson. All rights reserved. 00003 This file is part of the Code Vault version 4.1 00004 http://www.bombaydigital.com/ 00005 License: MIT. See LICENSE.md in the Vault top level directory. 00006 */ 00007 00008 #ifndef vabstractfilestream_h 00009 #define vabstractfilestream_h 00010 00013 #include "vstream.h" 00014 00015 #include "vfsnode.h" 00016 00029 class VAbstractFileStream : public VStream { 00030 public: 00031 00037 VAbstractFileStream(); 00042 VAbstractFileStream(const VFSNode& node); 00046 virtual ~VAbstractFileStream() {} 00047 00053 void setNode(const VFSNode& node); 00057 const VFSNode& getNode() const; 00058 00062 virtual void openReadOnly() = 0; 00067 virtual void openReadWrite() = 0; 00072 virtual void openWrite() = 0; 00076 virtual bool isOpen() const = 0; 00080 virtual void close() = 0; 00081 00082 // In addition to the pure virtual methods defined above, the 00083 // concrete subclass must also implement the stream methods 00084 // defined by VStream (read, write, flush, skip, seek, 00085 // offset, available). 00086 00087 protected: 00088 00097 void _throwIfOpenFailed(const VString& failedMethod, const VString& path); 00098 00099 VFSNode mNode; 00100 00101 }; 00102 00103 #endif /* vabstractfilestream_h */ 00104