PLCnext API Documentation  22.9.0.33
Classes | Enumerations | Functions
Arp::System::Commons::Io Namespace Reference

Namespace for classes related to the filesystem and file I/O More...

Classes

class  AccessDeniedException
 This exception is used when a requested file does not exist. More...
 
class  AlreadyExistsException
 This exception is used when a file should be created that already exists. More...
 
class  EndOfStreamException
 This is the base class of all IO exceptions. More...
 
class  InvalidPathException
 This exception is used when a requested file does not exist. More...
 
class  IoException
 This is the base class of all IO exceptions. More...
 
class  NotExistException
 This exception is used when a requested directory does not exist. More...
 
class  OutOfSpaceException
 This exception is used when a requested file does not exist. More...
 
class  Directory
 API for manipulation and examiniation of directories of a file system. More...
 
class  File
 API to manage and manipulate single files. More...
 
class  FileStream
 Exposes a Stream around a file, supporting read and write operations. More...
 
class  FileSystemInfo
 
class  MemoryStream
 
class  NullStream
 
class  Path
 
class  Stream
 Provides a generic view of a sequence of bytes. More...
 

Enumerations

enum class  FileMode {
  None = 0 , CreateNew = 1 , Create = 2 , Open = 3 ,
  OpenOrCreate = 4 , Truncate = 5 , Append = 6
}
 Contains constants for specifying how the OS should open a file. More...
 
enum class  FileAccess { None = 0 , Read = 1 , Write = 2 , ReadWrite = 3 }
 Contains constants for specifying the access you want for a file. You can have Read, Write or ReadWrite access. More...
 
enum class  SeekOrigin { None = 0 , Begin = 1 , Current = 2 , End = 3 }
 Provides seek reference points. To seek to the end of a stream, call stream.Seek(0, SeekOrigin.End). More...
 

Functions

void MapBoostErrorCodeToException (const String &path, const boost::system::error_code &boostErrorCode)
 
void MapBoostErrorCodeToException (const String &sourcePath, const String &destinationPath, const boost::system::error_code &boostErrorCode)
 
ARP_CXX_SYMBOL_EXPORT std::ostream & operator<< (std::ostream &os, FileMode value)
 
ARP_CXX_SYMBOL_EXPORT std::istream & operator>> (std::istream &is, FileMode &value)
 
ARP_CXX_SYMBOL_EXPORT std::ostream & operator<< (std::ostream &os, FileAccess value)
 
ARP_CXX_SYMBOL_EXPORT std::istream & operator>> (std::istream &is, FileAccess &value)
 
ARP_CXX_SYMBOL_EXPORT std::ostream & operator<< (std::ostream &os, SeekOrigin value)
 
ARP_CXX_SYMBOL_EXPORT std::istream & operator>> (std::istream &is, SeekOrigin &value)
 
constexpr FileSystemInfo::Traits operator& (FileSystemInfo::Traits lhs, FileSystemInfo::Traits rhs)
 
constexpr FileSystemInfo::Traits operator| (FileSystemInfo::Traits lhs, FileSystemInfo::Traits rhs)
 
constexpr FileSystemInfo::Permissions operator& (FileSystemInfo::Permissions lhs, FileSystemInfo::Permissions rhs)
 
constexpr FileSystemInfo::Permissions operator| (FileSystemInfo::Permissions lhs, FileSystemInfo::Permissions rhs)
 

Detailed Description

Namespace for classes related to the filesystem and file I/O

Enumeration Type Documentation

◆ FileAccess

Contains constants for specifying the access you want for a file. You can have Read, Write or ReadWrite access.

Enumerator
None 

Not specified

Read 

Specifies read access to the file. Data can be read from the file and the file pointer can be moved. Combine with WRITE for read-write access.

Write 

Specifies write access to the file. Data can be written to the file and the file pointer can be moved. Combine with READ for read-write access.

ReadWrite 

Specifies read and write access to the file. Data can be written to the file and the file pointer can be moved. Data can also be read from the file.

◆ FileMode

Contains constants for specifying how the OS should open a file.

The separate values in this enumeration will control whether you overwrite a file, open an existing file, or some combination thereof. To append to a file, use Append (which maps to OpenOrCreate then we seek to the end of the file). To truncate a file or create it if it doesn't exist, use Create.

Enumerator
None 

Not specified

CreateNew 

Creates a new file. An exception is raised if the file already exists.

Create 

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

Open 

Opens an existing file. An exception is raised if the file does not exist.

OpenOrCreate 

Opens the file for update, if it exists. Otherwise, creates a new file.

Truncate 

Opens an existing file. Once opened, the file is truncated so that its size is zero bytes. The calling process must open the file with at least WRITE access. An exception is raised if the file does not exist.

Append 

Opens the file if it exists and seeks to the end. Otherwise, creates a new file.

◆ SeekOrigin

Provides seek reference points. To seek to the end of a stream, call stream.Seek(0, SeekOrigin.End).

These constants match Win32's FILE_BEGIN, FILE_CURRENT, and FILE_END

Enumerator
None 

Not specified

Begin 

Specifies the beginning of a stream.

Current 

Specifies the current position of a stream.

End 

Specifies the end of a stream.