Asposecpplib
System::IO Namespace Reference

Namespaces

 Compression
 
 Details
 

Classes

class  Details_IOException
 
class  Details_EndOfStreamException
 
class  Details_InvalidDataException
 
class  Details_DirectoryNotFoundException
 
class  Details_FileLoadException
 
class  Details_PathTooLongException
 
class  BinaryReader
 Represents a reader that reads primitive data types as binary data in particular encoding. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  BinaryWriter
 Represents a writer that writes values of primitive types to a byte stream. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  BufferedStream
 Adds a buffering layer on top of another stream. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  Directory
 Contains methods for manipulating directories. This is a static type with no instance services. You should never create instances of it by any means. More...
 
class  DirectoryInfo
 Represents a file system path, a directory referred to by this path and provides instance methods for manipulating directories. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  File
 Provides methods for manipulating files. This is a static type with no instance services. You should never create instances of it by any means. More...
 
class  FileInfo
 Represents a path to a file and a file referred to by this path and provides methods for manipulating it. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  Details_FileNotFoundException
 The exception that is thrown when an attempt to access a file that does not exist on disk fails. Never create instances of this class manually. Use the FileNotFoundException class instead. Never wrap the FileNotFoundException class instances into System::SmartPtr. More...
 
class  FileStream
 Represents a file stream supporting synchronous and asynchronous read and write operations. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  FileSystemInfoStat
 Represents information about a file or directory. More...
 
class  FileSystemInfo
 The base class for FileInfo and DirectoryInfo. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  MemoryStream
 Represents a stream that reads from and writes to memory. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  Path
 Provides methods for manipulating paths. This is a static type with no instance services. You should never create instances of it by any means. More...
 
class  STDIOStreamWrapperBase
 Represents a base class for System.IO.Stream-like wrappers. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  BasicSTDIStreamWrapper
 Represents a System.IO.Stream-like wrapper for std::basic_istream and its derived objects. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  BasicSTDOStreamWrapper
 Represents a System.IO.Stream-like wrapper for std::basic_ostream and its derived objects. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  BasicSTDIOStreamWrapper
 Represents a System.IO.Stream-like wrapper for std::basic_iostream and its derived objects. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  Stream
 A base class for a variety of stream implementations. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  StreamReader
 Represents a reader that reads characters from a byte stream. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  StreamWriter
 Represents a writer that writes characters to a byte stream. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  StringReader
 Represents a reader that reads characters from a string. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  StringWriter
 Implements a TextWriter that writes information to a string. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  BasicSystemIOStreamBuf
 Represents a buffer that wraps System::IO::Stream-like streams and allows them to be used as an std::iostream-like streams 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  BasicSystemIOStreamWrapper
 Represents a std::iostream-like wrapper that used BasicSystemIOStreamBuf as internal buffer. More...
 
class  TextReader
 A base class for classes that represent readers that read sequences of characters from different sources. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  TextWriter
 A base class for classes that represent writers that writes sequences of characters to different destinations. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 
class  UnmanagedMemoryStream
 Provides access to unmanaged memory. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...
 

Typedefs

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

Functions

const System::StringCURRENT_NAMESPACE ()
 
 DECLARE_ENUM_OPERATORS (System::IO::FileAccess)
 Declaration of template arithmetic operators for values of the FileAccess enum type. More...
 
 DECLARE_ENUM_OPERATORS (System::IO::FileAttributes)
 Declaration of template arithmetic operators for values of the FileAttributes enum type. More...
 
 DECLARE_ENUM_OPERATORS (System::IO::FileOptions)
 Declaration of template arithmetic operators for values of the FileOptions enum type. More...
 
 DECLARE_ENUM_OPERATORS (System::IO::FileShare)
 Declaration of template arithmetic operators for values of the FileShare enum type. More...
 
template<typename char_type , typename traits_type >
SharedPtr< StreamWrapSTDIOStream (std::basic_istream< char_type, traits_type > &stream, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary)
 Wrapper function for std::basic_istream-like streams. More...
 
template<typename char_type , typename traits_type >
SharedPtr< StreamWrapSTDIOStream (std::basic_ostream< char_type, traits_type > &stream, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary)
 Wrapper function for std::basic_ostream-like streams. More...
 
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)
 Wrapper function for std::basic_iostream-like streams. More...
 

Typedef Documentation

◆ BinaryWriterPtr

An alias for a shared pointer to this class.

◆ DirectoryNotFoundException

◆ EndOfStreamException

◆ FileLoadException

◆ FileNotFoundException

◆ InvalidDataException

◆ IOException

◆ PathTooLongException

◆ 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

◆ CURRENT_NAMESPACE()

const System::String& System::IO::CURRENT_NAMESPACE ( )
inline

◆ DECLARE_ENUM_OPERATORS() [1/4]

System::IO::DECLARE_ENUM_OPERATORS ( System::IO::FileAccess  )

Declaration of template arithmetic operators for values of the FileAccess enum type.

◆ DECLARE_ENUM_OPERATORS() [2/4]

System::IO::DECLARE_ENUM_OPERATORS ( System::IO::FileAttributes  )

Declaration of template arithmetic operators for values of the FileAttributes enum type.

◆ DECLARE_ENUM_OPERATORS() [3/4]

System::IO::DECLARE_ENUM_OPERATORS ( System::IO::FileOptions  )

Declaration of template arithmetic operators for values of the FileOptions enum type.

◆ DECLARE_ENUM_OPERATORS() [4/4]

System::IO::DECLARE_ENUM_OPERATORS ( System::IO::FileShare  )

Declaration of template arithmetic operators for values of the FileShare enum type.

◆ WrapSTDIOStream() [1/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

◆ WrapSTDIOStream() [2/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() [3/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