Advertisement
Guest User

winuwp-stream.h

a guest
Oct 17th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include "common/noncopyable.h"
  2. #include "common/stream.h"
  3.  
  4. using namespace Windows::Storage;
  5.  
  6. class WinUWPStream : public Common::SeekableReadStream, public Common::WriteStream, public Common::NonCopyable {
  7. protected:
  8.     Streams::IRandomAccessStream^ _stream;
  9.     bool _error;
  10.     bool _eos;
  11.  
  12. public:
  13.  
  14.     static WinUWPStream *makeFromPath(const Common::String &path, bool writeMode);
  15.    
  16.     Common::String _path;
  17.  
  18.     WinUWPStream::WinUWPStream(Streams::IRandomAccessStream^ stream);
  19.     virtual ~WinUWPStream();
  20.  
  21.     virtual bool err() const;
  22.     virtual void clearErr();
  23.     virtual bool eos() const;
  24.     virtual bool eof();
  25.  
  26.     virtual uint32 write(const void *dataPtr, uint32 dataSize);
  27.     virtual bool flush();
  28.  
  29.     virtual int32 pos() const;
  30.     virtual int32 size() const;
  31.     virtual bool seek(int32 offs, int whence = SEEK_SET);
  32.     virtual uint32 read(void *ptr, uint32 len);
  33.  
  34. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement