System::IO Namespace Reference

Namespaces

 Compression
 

Classes

class  BasicSTDIOStreamWrapper
 
class  BasicSTDIStreamWrapper
 
class  BasicSTDOStreamWrapper
 
class  BasicSystemIOStreamBuf
 
class  BasicSystemIOStreamWrapper
 Represents a std::iostream-like wrapper that used BasicSystemIOStreamBuf as internal buffer. More...
 
class  BasicSystemIStreamWrapper
 Represents a std::istream-like wrapper that used BasicSystemIOStreamBuf as internal buffer. More...
 
class  BasicSystemOStreamWrapper
 Represents a std::ostream-like wrapper that used BasicSystemIOStreamBuf as internal buffer. More...
 
class  BinaryReader
 
class  BinaryWriter
 
class  BufferedStream
 
class  Details_FileNotFoundException
 
class  Directory
 
class  DirectoryInfo
 
class  File
 
class  FileInfo
 
class  FileStream
 
class  FileSystemInfo
 
class  FileSystemInfoStat
 Represents information about a file or directory. More...
 
class  MemoryStream
 
class  Path
 
class  STDIOStreamWrapperBase
 
class  Stream
 
class  StreamReader
 
class  StreamWriter
 
class  StringReader
 
class  StringWriter
 
class  TextReader
 
class  TextWriter
 
class  UnmanagedMemoryStream
 

Typedefs

typedef SharedPtr< BinaryWriterBinaryWriterPtr
 An alias for a shared pointer to this class. More...
 
using FileNotFoundException = System::ExceptionWrapper< Details_FileNotFoundException >
 
using STDIStreamWrapper = BasicSTDIStreamWrapper< std::istream >
 Specializations of BasicSTDIStreamWrapper for char character types. More...
 
using STDWIStreamWrapper = BasicSTDIStreamWrapper< std::wistream >
 Specializations of BasicSTDIStreamWrapper for wchar_t character types. More...
 
using STDOStreamWrapper = BasicSTDOStreamWrapper< std::ostream >
 Specializations of BasicSTDOStreamWrapper for char character types. More...
 
using STDWOStreamWrapper = BasicSTDOStreamWrapper< std::wostream >
 Specializations of BasicSTDOStreamWrapper for wchar_t character types. More...
 
using STDIOStreamWrapper = BasicSTDIOStreamWrapper< std::iostream >
 Specializations of BasicSTDIOStreamWrapper for char character types. More...
 
using STDWIOStreamWrapper = BasicSTDIOStreamWrapper< std::wiostream >
 Specializations of BasicSTDIOStreamWrapper for wchar_t character types. More...
 
using SystemIStreamWrapper = BasicSystemIStreamWrapper< char, std::char_traits< char > >
 Specializations of BasicSystemIStreamWrapper for char character types. More...
 
using SystemWIStreamWrapper = BasicSystemIStreamWrapper< wchar_t, std::char_traits< wchar_t > >
 Specializations of BasicSystemIStreamWrapper for wchar_t character types. More...
 
using SystemOStreamWrapper = BasicSystemOStreamWrapper< char, std::char_traits< char > >
 Specializations of BasicSystemOStreamWrapper for char character types. More...
 
using SystemWOStreamWrapper = BasicSystemOStreamWrapper< wchar_t, std::char_traits< wchar_t > >
 Specializations of BasicSystemOStreamWrapper for wchar_t character types. More...
 
using SystemIOStreamWrapper = BasicSystemIOStreamWrapper< char, std::char_traits< char > >
 Specializations of BasicSystemIOStreamWrapper for char character types. More...
 
using SystemWIOStreamWrapper = BasicSystemIOStreamWrapper< wchar_t, std::char_traits< wchar_t > >
 Specializations of BasicSystemIOStreamWrapper for wchar_t character types. More...
 

Enumerations

enum  FileAccess { FileAccess::Read = 0x00000001, FileAccess::Write = 0x00000002, FileAccess::ReadWrite = Read | Write }
 Specifies the type of access when opening the file. More...
 
enum  FileAttributes {
  FileAttributes::Archive = 0x00020, FileAttributes::Compressed = 0x00800, FileAttributes::Device = 0x00040, FileAttributes::Directory = 0x00010,
  FileAttributes::Encrypted = 0x04000, FileAttributes::Hidden = 0x00002, FileAttributes::IntegrityStream = 0x8000, FileAttributes::Normal = 0x00080,
  FileAttributes::NotContentIndexed = 0x02000, FileAttributes::NoScrubData = 0x20000, FileAttributes::Offline = 0x01000, FileAttributes::ReadOnly = 0x00001,
  FileAttributes::ReparsePoint = 0x00400, FileAttributes::SparseFile = 0x00200, FileAttributes::System = 0x00004, FileAttributes::Temporary = 0x00100,
  FileAttributes::Invalid = 0
}
 Represents attributes of a directory or a file. More...
 
enum  FileMode {
  FileMode::CreateNew = 1, FileMode::Create = 2, FileMode::Open = 3, FileMode::OpenOrCreate = 4,
  FileMode::Truncate = 5, FileMode::Append = 6
}
 Specifies how a file should be opened. More...
 
enum  FileOptions {
  FileOptions::None = 0, FileOptions::Encrypted = 0x4000, FileOptions::DeleteOnClose = 0x4000000, FileOptions::SequentialScan = 0x8000000,
  FileOptions::RandomAccess = 0x10000000, FileOptions::Asynchronous = 0x40000000, FileOptions::WriteThrough = (std::numeric_limits<int32_t>::min)()
}
 Represents advanced options for creating FileStream object. More...
 
enum  FileShare {
  FileShare::None = 0, FileShare::Read = 1, FileShare::Write = 2, FileShare::ReadWrite = 3,
  FileShare::Delete = 4, FileShare::Inheritable = 16
}
 Specifies what kind of access other FileStream objects can have to a file being opened. More...
 
enum  SearchOption { SearchOption::AllDirectories, SearchOption::TopDirectoryOnly }
 
enum  SeekOrigin { SeekOrigin::Begin = 0, SeekOrigin::Current, SeekOrigin::End }
 
enum  STDIOStreamWrappingMode { STDIOStreamWrappingMode::Binary, STDIOStreamWrappingMode::Conversion }
 Specifies the mode of I/O operations that wrappers will perform on std::iostreams-like streams. More...
 
enum  STDIOStreamPositionPreference { STDIOStreamPositionPreference::Zero, STDIOStreamPositionPreference::ReadPosition, STDIOStreamPositionPreference::WritePosition }
 
enum  SystemIOStreamWrappingMode { SystemIOStreamWrappingMode::Binary, SystemIOStreamWrappingMode::Conversion }
 Specifies the mode of I/O operations that wrappers will perform on System::IO::Stream-like streams. More...
 

Functions

template<typename char_type , typename traits_type >
SharedPtr< StreamWrapSTDIOStream (std::basic_istream< char_type, traits_type > &stream, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary)
 
template<typename char_type , typename traits_type >
SharedPtr< StreamWrapSTDIOStream (std::basic_ostream< char_type, traits_type > &stream, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary)
 
template<typename char_type , typename traits_type >
SharedPtr< StreamWrapSTDIOStream (std::basic_iostream< char_type, traits_type > &stream, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary, STDIOStreamPositionPreference pref_pos=STDIOStreamPositionPreference::Zero)
 

Typedef Documentation

◆ BinaryWriterPtr

An alias for a shared pointer to this class.

◆ FileNotFoundException

using System::IO::FileNotFoundException = typedef System::ExceptionWrapper<Details_FileNotFoundException>

The exception that is thrown when an attempt to access a file that does not exist on disk fails. Never wrap the FileNotFoundException class instances into System::SmartPtr.

◆ STDIOStreamWrapper

Specializations of BasicSTDIOStreamWrapper for char character types.

◆ STDIStreamWrapper

Specializations of BasicSTDIStreamWrapper for char character types.

◆ STDOStreamWrapper

Specializations of BasicSTDOStreamWrapper for char character types.

◆ STDWIOStreamWrapper

Specializations of BasicSTDIOStreamWrapper for wchar_t character types.

◆ STDWIStreamWrapper

Specializations of BasicSTDIStreamWrapper for wchar_t character types.

◆ STDWOStreamWrapper

Specializations of BasicSTDOStreamWrapper for wchar_t character types.

◆ SystemIOStreamWrapper

using System::IO::SystemIOStreamWrapper = typedef BasicSystemIOStreamWrapper<char, std::char_traits<char> >

Specializations of BasicSystemIOStreamWrapper for char character types.

◆ SystemIStreamWrapper

using System::IO::SystemIStreamWrapper = typedef BasicSystemIStreamWrapper<char, std::char_traits<char> >

Specializations of BasicSystemIStreamWrapper for char character types.

◆ SystemOStreamWrapper

using System::IO::SystemOStreamWrapper = typedef BasicSystemOStreamWrapper<char, std::char_traits<char> >

Specializations of BasicSystemOStreamWrapper for char character types.

◆ SystemWIOStreamWrapper

using System::IO::SystemWIOStreamWrapper = typedef BasicSystemIOStreamWrapper<wchar_t, std::char_traits<wchar_t> >

Specializations of BasicSystemIOStreamWrapper for wchar_t character types.

◆ SystemWIStreamWrapper

using System::IO::SystemWIStreamWrapper = typedef BasicSystemIStreamWrapper<wchar_t, std::char_traits<wchar_t> >

Specializations of BasicSystemIStreamWrapper for wchar_t character types.

◆ SystemWOStreamWrapper

using System::IO::SystemWOStreamWrapper = typedef BasicSystemOStreamWrapper<wchar_t, std::char_traits<wchar_t> >

Specializations of BasicSystemOStreamWrapper for wchar_t character types.

Enumeration Type Documentation

◆ FileAccess

Specifies the type of access when opening the file.

Enumerator
Read 

Read-only access.

Write 

Write-only access.

ReadWrite 

Read and write access.

◆ FileAttributes

Represents attributes of a directory or a file.

Enumerator
Archive 

The filesystem entity is a candidate for removal or backup.

Compressed 

The filesystem entity is compressed.

Device 

Not used.

Directory 

The filesystem entity is a directory.

Encrypted 

The filesystem entity is encrypted.

Hidden 

The filesystem entity is hidden.

IntegrityStream 

The filesystem entity contains data integrity support.

Normal 

The filesystem entity is a file that has no special attributes.

NotContentIndexed 

The filesystem entity will not be indexed by the content indexing service.

NoScrubData 

The filesystem entity is not included in the data integrity scan.

Offline 

The filesystem entity is offline and its data is not immediately available.

ReadOnly 

The filesystem entity is read-only.

ReparsePoint 

The filesystem entity is a file that contains a reparse point.

SparseFile 

The filesystem entity is a sparse file.

System 

The filesystem entity is a system file.

Temporary 

The filesystem entity is a temporary file.

Invalid 

Invalid value.

◆ FileMode

enum System::IO::FileMode
strong

Specifies how a file should be opened.

Enumerator
CreateNew 

Create a new file. If the file already exists, an exception is thrown.

Create 

Create a new file. If the file already exists, it is overwritten.

Open 

Open an existing file. If the file does not exist, an exception is thrown.

OpenOrCreate 

Open an existing file or create a new one if it does not exist.

Truncate 

Open an existing file and truncate it so that it is empty. If the file does not exist, an exception is thrown.

Append 

Open an existing file and seek to the end of it or create a new one if it does not exist.

◆ FileOptions

Represents advanced options for creating FileStream object.

Enumerator
None 

No additional options.

Encrypted 

The file is encrypted. NOT IMPLEMENTED.

DeleteOnClose 

The file should be automatically deleted when it is not in use anymore.

SequentialScan 

The file shoud be accesses sequentially.

RandomAccess 

The file is accessed randomly.

Asynchronous 

The file can be used for asynchronous I/O operations. NOT IMPLEMENTED.

WriteThrough 

All writes should go directly to the disk bypassing any intermediate cache.

◆ FileShare

enum System::IO::FileShare
strong

Specifies what kind of access other FileStream objects can have to a file being opened.

Enumerator
None 

No access.

Read 

Read-only access.

Write 

Write-only access.

ReadWrite 

Read and Write access.

Delete 

The file can be deleted.

Inheritable 

Makes file handle inheritable by child processes.

◆ SearchOption

Specifies a search should be performed only in the current directory, or in the current directory and all its subdirectories.

Enumerator
AllDirectories 

Search in the current directory and all its subdirectories.

TopDirectoryOnly 

Search in the current directory only.

◆ SeekOrigin

Specifies the reference position in the stream relative to which the position to seek to is specified.

Enumerator
Begin 

Beginning of the stream.

Current 

Current stream position.

End 

End of the stream.

◆ STDIOStreamPositionPreference

Determines which position in the stream is preferable as a common read and write position when std::basic_iostream and its descendants will have different read and write positions at the time of wrapper creation.

Enumerator
Zero 

Zero position will sets as a read and write position.

ReadPosition 

gptr position will sets as a read and write position.

WritePosition 

pptr position will sets as a read and write position.

◆ STDIOStreamWrappingMode

Specifies the mode of I/O operations that wrappers will perform on std::iostreams-like streams.

Enumerator
Binary 

A mode that allows input operations to decode stream data of char_type type into bytes, and encode bytes into char_type data for output operations.

Conversion 

A mode that allows input operations to convert stream data from char_type type to uint8_t type and vice versa for output operations.

◆ SystemIOStreamWrappingMode

Specifies the mode of I/O operations that wrappers will perform on System::IO::Stream-like streams.

Enumerator
Binary 

A mode that allows input operations to encode stream bytes into char_type data and decode char_type data into stream bytes for output operations.

Conversion 

A mode that allows input operations to convert stream bytes from uint8_t type to char_type type and vice versa for output operations.

Function Documentation

◆ WrapSTDIOStream() [1/3]

template<typename char_type , typename traits_type >
SharedPtr<Stream> System::IO::WrapSTDIOStream ( std::basic_istream< char_type, traits_type > &  stream,
STDIOStreamWrappingMode  mode = STDIOStreamWrappingMode::Binary 
)

Wrapper function for std::basic_istream-like streams.

Parameters
streamstd::basic_istream-like stream
modeWrapping mode
Returns
BasicSTDIStreamWrapper wrapper

◆ WrapSTDIOStream() [2/3]

template<typename char_type , typename traits_type >
SharedPtr<Stream> System::IO::WrapSTDIOStream ( std::basic_ostream< char_type, traits_type > &  stream,
STDIOStreamWrappingMode  mode = STDIOStreamWrappingMode::Binary 
)

Wrapper function for std::basic_ostream-like streams.

Parameters
streamstd::basic_ostream-like stream
modeWrapping mode
Returns
BasicSTDOStreamWrapper wrapper

◆ WrapSTDIOStream() [3/3]

template<typename char_type , typename traits_type >
SharedPtr<Stream> System::IO::WrapSTDIOStream ( std::basic_iostream< char_type, traits_type > &  stream,
STDIOStreamWrappingMode  mode = STDIOStreamWrappingMode::Binary,
STDIOStreamPositionPreference  pref_pos = STDIOStreamPositionPreference::Zero 
)

Wrapper function for std::basic_iostream-like streams.

Parameters
streamstd::basic_iostream-like stream
modeWrapping mode
pref_posPosition that will prefer as read and write position, if they are different
Returns
BasicSTDIOStreamWrapper wrapper