Evo C++ Library v0.5.1
Public Types | Public Member Functions | Public Attributes | List of all members
StreamMT< File > Struct Template Reference

#include <evo/iothread.h>

Detailed Description

template<>
struct evo::StreamMT< File >

Stream with mutex for multithreaded synchronization, specialized for File.

Public Types

typedef StreamMT< FileThis
 This type. More...
 

Public Member Functions

 StreamMT (Newline nl=NL, bool exceptions=1)
 Constructor. More...
 
 StreamMT (const char *path, Open mode=oREAD, bool flushlines=false, Newline nl=NL_SYS, bool exceptions=1)
 Constructor to open file. More...
 

Public Attributes

Mutex mutex
 Stream mutex. More...
 
File stream
 Stream object. More...
 

Member Typedef Documentation

◆ This

typedef StreamMT<File> This

This type.

Constructor & Destructor Documentation

◆ StreamMT() [1/2]

StreamMT ( Newline  nl = NL,
bool  exceptions = 1 
)
inline

Constructor.

  • This initializes without opening a file, use open() to open a file
Parameters
nlDefault newline value to use for text reads/writes
exceptionsWhether to enable exceptions on error, default set by Evo config: EVO_EXCEPTIONS

◆ StreamMT() [2/2]

StreamMT ( const char *  path,
Open  mode = oREAD,
bool  flushlines = false,
Newline  nl = NL_SYS,
bool  exceptions = 1 
)
inline

Constructor to open file.

  • Throws ExceptionStreamOpen on error, if exceptions enabled
  • If exceptions disabled: Call error() to check for error
Parameters
pathFile path to use
modeAccess mode to use
flushlinesWhether to flush text output on newlines (line buffering)
nlDefault newline value to use for text reads/writes
exceptionsWhether to enable exceptions on error, default set by Evo config: EVO_EXCEPTIONS

Member Data Documentation

◆ mutex

Mutex mutex

Stream mutex.

◆ stream

File stream

Stream object.


The documentation for this struct was generated from the following file: