DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
FileStream.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
Common.h
"
4
#include "
System/IO/Stream.h
"
5
#include "
System/String.h
"
6
7
namespace
DotNetDupe
{
8
namespace
System
{
9
namespace
IO
{
16
class
FileStream
:
public
Stream
{
17
public
:
23
DOTNETDUPE_API
FileStream
(
const
String
& sPath,
int
iMode);
24
26
DOTNETDUPE_API
~FileStream
()
override
;
27
30
DOTNETDUPE_API
bool
CanRead
()
const override
;
31
34
DOTNETDUPE_API
bool
CanSeek
()
const override
;
35
38
DOTNETDUPE_API
bool
CanWrite
()
const override
;
39
43
DOTNETDUPE_API
long
GetLength
()
const override
;
44
48
DOTNETDUPE_API
long
GetPosition
()
const override
;
49
53
DOTNETDUPE_API
void
SetPosition
(
long
llValue)
override
;
54
57
DOTNETDUPE_API
void
Flush
()
override
;
58
65
DOTNETDUPE_API
int
Read
(
char
* pBuffer,
int
iOffset,
int
nCount)
override
;
66
73
DOTNETDUPE_API
long
Seek
(
long
llOffset,
int
iOrigin)
override
;
74
78
DOTNETDUPE_API
void
SetLength
(
long
llValue)
override
;
79
85
DOTNETDUPE_API
void
Write
(
const
char
* pBuffer,
int
iOffset,
int
nCount)
override
;
86
88
DOTNETDUPE_API
void
Dispose
()
override
;
89
90
private
:
91
struct
Impl;
92
Impl* m_pImpl;
93
String
m_sPath;
94
int
m_iMode;
95
bool
m_bCanRead;
96
bool
m_bCanWrite;
97
bool
m_bCanSeek;
98
};
99
}
100
}
101
}
Common.h
Defines common cross-platform macros, export decorators, and fundamental types.
DOTNETDUPE_API
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition
Common.h:20
Stream.h
String.h
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
DotNetDupe::System::IO::FileStream::Read
int Read(char *pBuffer, int iOffset, int nCount) override
Reads a block of bytes from the stream and writes the data in a given buffer.
Definition
FileStream.cpp:128
DotNetDupe::System::IO::FileStream::CanSeek
bool CanSeek() const override
Gets a value indicating whether the current stream supports seeking.
Definition
FileStream.cpp:74
DotNetDupe::System::IO::FileStream::Write
void Write(const char *pBuffer, int iOffset, int nCount) override
Writes a block of bytes to the file stream.
Definition
FileStream.cpp:175
DotNetDupe::System::IO::FileStream::Seek
long Seek(long llOffset, int iOrigin) override
Sets the current position of this stream to the given value.
Definition
FileStream.cpp:148
DotNetDupe::System::IO::FileStream::CanRead
bool CanRead() const override
Gets a value indicating whether the current stream supports reading.
Definition
FileStream.cpp:70
DotNetDupe::System::IO::FileStream::SetPosition
void SetPosition(long llValue) override
Sets the current position within the stream.
Definition
FileStream.cpp:107
DotNetDupe::System::IO::FileStream::GetLength
long GetLength() const override
Gets the length in bytes of the stream.
Definition
FileStream.cpp:82
DotNetDupe::System::IO::FileStream::Flush
void Flush() override
Clears buffers for this stream and causes any unwritten data to be written to the file.
Definition
FileStream.cpp:117
DotNetDupe::System::IO::FileStream::GetPosition
long GetPosition() const override
Gets the current position within the stream.
Definition
FileStream.cpp:97
DotNetDupe::System::IO::FileStream::SetLength
void SetLength(long llValue) override
Sets the length of this stream to the given value.
Definition
FileStream.cpp:171
DotNetDupe::System::IO::FileStream::Dispose
void Dispose() override
Releases all unmanaged resources used by the FileStream.
Definition
FileStream.cpp:188
DotNetDupe::System::IO::FileStream::CanWrite
bool CanWrite() const override
Gets a value indicating whether the current stream supports writing.
Definition
FileStream.cpp:78
DotNetDupe::System::IO::FileStream::FileStream
FileStream(const String &sPath, int iMode)
Initializes a new instance of the FileStream class with the specified path and creation mode.
Definition
FileStream.cpp:52
DotNetDupe::System::IO::Stream
Provides a generic view of a sequence of bytes.
Definition
Stream.h:16
DotNetDupe::System::String
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition
String.h:74
DotNetDupe::System::IO
Definition
Console.h:17
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
Include
System
IO
FileStream.h
Generated by
1.18.0