DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System::IO Namespace Reference

Classes

class  BinaryReader
 Reads primitive data types as binary values in a specific encoding. More...
class  BinaryWriter
 Writes primitive types in binary to a stream and supports writing strings in a specific encoding. More...
class  Directory
 Exposes static methods for creating, moving, and enumerating through directories and subdirectories. More...
class  DirectoryNotFoundException
 The exception that is thrown when part of a file or directory cannot be found. More...
class  EndOfStreamException
 The exception that is thrown when reading is attempted past the end of a stream. More...
class  File
 Provides static methods for the creation, copying, deletion, moving, and opening of files. More...
class  FileNotFoundException
 The exception that is thrown when an attempt to access a file that does not exist on disk fails. More...
class  FileStream
 Provides a Stream for a file, supporting both synchronous read and write operations. More...
interface  IDisposable
 Provides a mechanism for releasing unmanaged resources. More...
class  IOException
 The exception that is thrown when an I/O error occurs. More...
class  MemoryStream
 Creates a stream whose backing store is memory. More...
class  MockStream
 Controllable stream implementation for unit testing IO consumers. More...
class  Path
 Performs operations on String instances that contain file or directory path information. More...
class  Stream
 Provides a generic view of a sequence of bytes. More...
class  StringReader
 Implements a TextReader that reads from a string. More...
class  StringWriter
 Implements a TextWriter that writes information to a string. More...
class  TextReader
 Represents a reader that can read a sequential series of characters. More...
class  TextWriter
 Represents a writer that can write a sequential series of characters. More...

Typedefs

using BinaryReaderPtr = SmartPointer<BinaryReader>
using BinaryWriterPtr = SmartPointer<BinaryWriter>

Enumerations

enum class  FileAttributes {
  Normal = 0 , ReadOnly = 1 , Hidden = 2 , System = 4 ,
  Directory = 16 , Archive = 32 , Device = 64 , Temporary = 128 ,
  SparseFile = 256 , ReparsePoint = 512 , Compressed = 1024 , Offline = 2048 ,
  NotContentIndexed = 4096 , Encrypted = 8192 , IntegrityStream = 16384 , NoScrubData = 32768
}
 Provides attributes for files and directories. More...

Functions

static void AppendPathSegment (String &sJoined, const String &sPath)
static long CalculateSeekPosition (long currentPos, long length, long offset, int origin)
 Calculate new absolute position from origin and offset.
static std::ios_base::openmode DetermineOpenMode (int iMode, const String &sPath, bool &bCanRead, bool &bCanWrite, bool &bCanSeek)
 Determine stream openmode and capability flags from FileMode.
static int FindNewlineIndex (const String &sSource, int startPos, int length)
 Find index of newline character in source string.
static String GenerateRandomTempFileName (const String &sTempDir)
static void ReverseBytes (char *pBuf, int iSize)
 Reverse bytes in place for endian conversion.
static void ReverseBytes (char *pBuf, int iSize)
 Reverse bytes in place for endian conversion.
static bool ValidatePathChars (const std::initializer_list< String > &sPaths)

Typedef Documentation

◆ BinaryReaderPtr

◆ BinaryWriterPtr

Enumeration Type Documentation

◆ FileAttributes

Provides attributes for files and directories.

Enumerator
Normal 
ReadOnly 
Hidden 
System 
Directory 
Archive 
Device 
Temporary 
SparseFile 
ReparsePoint 
Compressed 
Offline 
NotContentIndexed 
Encrypted 
IntegrityStream 
NoScrubData 

Definition at line 16 of file File.h.

Function Documentation

◆ AppendPathSegment()

void DotNetDupe::System::IO::AppendPathSegment ( String & sJoined,
const String & sPath )
static

◆ CalculateSeekPosition()

long DotNetDupe::System::IO::CalculateSeekPosition ( long currentPos,
long length,
long offset,
int origin )
static

Calculate new absolute position from origin and offset.

Definition at line 96 of file MemoryStream.cpp.

References DotNetDupe::System::ArgumentException::ArgumentException(), and CalculateSeekPosition().

Referenced by CalculateSeekPosition(), and DotNetDupe::System::IO::MemoryStream::Seek().

◆ DetermineOpenMode()

std::ios_base::openmode DotNetDupe::System::IO::DetermineOpenMode ( int iMode,
const String & sPath,
bool & bCanRead,
bool & bCanWrite,
bool & bCanSeek )
static

Determine stream openmode and capability flags from FileMode.

Guard: Validate mode range.

Handle append mode separately.

Configure read-write seeking stream.

Definition at line 34 of file FileStream.cpp.

References DotNetDupe::System::ArgumentException::ArgumentException(), DotNetDupe::System::IO::IOException::IOException(), and DetermineOpenMode().

Referenced by DotNetDupe::System::IO::FileStream::FileStream(), and DetermineOpenMode().

◆ FindNewlineIndex()

int DotNetDupe::System::IO::FindNewlineIndex ( const String & sSource,
int startPos,
int length )
static

Find index of newline character in source string.

Definition at line 46 of file StringReader.cpp.

References FindNewlineIndex().

Referenced by FindNewlineIndex(), and DotNetDupe::System::IO::StringReader::ReadLine().

◆ GenerateRandomTempFileName()

String DotNetDupe::System::IO::GenerateRandomTempFileName ( const String & sTempDir)
static

Step: Generate and create empty unique temporary file in temp directory.

Definition at line 228 of file Path.cpp.

References DotNetDupe::System::IO::IOException::IOException(), DotNetDupe::System::String::String(), and GenerateRandomTempFileName().

Referenced by GenerateRandomTempFileName(), and DotNetDupe::System::IO::Path::GetTempFileName().

◆ ReverseBytes() [1/2]

void DotNetDupe::System::IO::ReverseBytes ( char * pBuf,
int iSize )
static

◆ ReverseBytes() [2/2]

void DotNetDupe::System::IO::ReverseBytes ( char * pBuf,
int iSize )
static

◆ ValidatePathChars()

bool DotNetDupe::System::IO::ValidatePathChars ( const std::initializer_list< String > & sPaths)
static

Step: Check whether any segment contains illegal path characters.

Definition at line 304 of file Path.cpp.

References DotNetDupe::System::String::Contains(), DotNetDupe::System::IO::Path::GetInvalidPathChars(), and ValidatePathChars().

Referenced by DotNetDupe::System::IO::Path::TryJoin(), and ValidatePathChars().