DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
Stream.h
Go to the documentation of this file.
1#pragma once
2
3#include "Common.h"
4#include "System/Object.h"
6
7namespace DotNetDupe {
8 namespace System {
9 namespace IO {
16 class Stream : public Object, public IDisposable {
17 public:
19 virtual ~Stream() = default;
20
23 virtual bool CanRead() const = 0;
24
27 virtual bool CanSeek() const = 0;
28
31 virtual bool CanWrite() const = 0;
32
36 virtual long GetLength() const = 0;
37
41 virtual long GetPosition() const = 0;
42
46 virtual void SetPosition(long value) = 0;
47
49 virtual void Flush() = 0;
50
56 virtual int Read(char* buffer, int offset, int count) = 0;
57
62 virtual long Seek(long offset, int origin) = 0;
63
66 virtual void SetLength(long value) = 0;
67
72 virtual void Write(const char* buffer, int offset, int count) = 0;
73
75 virtual void Dispose() = 0;
76 };
77 }
78 }
79}
Defines common cross-platform macros, export decorators, and fundamental types.
Base object class for DotNetDupe mirroring .NET System.Object.
Provides a mechanism for releasing unmanaged resources.
Definition IDisposable.h:13
Provides a generic view of a sequence of bytes.
Definition Stream.h:16
virtual long Seek(long offset, int origin)=0
Sets the position within the current stream.
virtual ~Stream()=default
Virtual destructor ensuring proper polymorphic destruction.
virtual void Write(const char *buffer, int offset, int count)=0
Writes a sequence of bytes to the current stream and advances the current position within this stream...
virtual void Flush()=0
Clears all buffers for this stream and causes any buffered data to be written to the underlying devic...
virtual void SetPosition(long value)=0
Sets the position within the current stream.
virtual long GetLength() const =0
Gets the length in bytes of the stream.
virtual void SetLength(long value)=0
Sets the length of the current stream.
virtual bool CanRead() const =0
Gets a value indicating whether the current stream supports reading.
virtual long GetPosition() const =0
Gets the position within the current stream.
virtual bool CanWrite() const =0
Gets a value indicating whether the current stream supports writing.
virtual int Read(char *buffer, int offset, int count)=0
Reads a sequence of bytes from the current stream and advances the position within the stream by the ...
virtual bool CanSeek() const =0
Gets a value indicating whether the current stream supports seeking.
virtual void Dispose()=0
Releases all resources used by the Stream.
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18