VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
VICI::cfi::FD Class Reference

Wrap file descriptors in a class to ensure closed. More...

#include <sos/fdstream.h>

Public Member Functions

 FD (const std::string &name, int mode, bool lock)
 constructor which opens the file More...
 
 FD (int x)
 constructor for existing file descriptor More...
 
 ~FD ()
 destructor
 
 operator int ()
 type conversion
 

Static Public Member Functions

static void report (std::ostream &s, int fd)
 Report the details or status of a file descriptor. More...
 

Detailed Description

Wrap file descriptors in a class to ensure closed.

The FD class is used to wrap a file descriptor so that it will be automatically closed when it goes out of scope. This ensures that file descriptors are closed when an exception is thrown.

Constructor & Destructor Documentation

FD::FD ( const std::string &  name,
int  mode,
bool  lock 
)

constructor which opens the file

Parameters
namethe name of file to open
modethe open mode
lockif true the file is also locked
VICI::cfi::FD::FD ( int  x)
inline

constructor for existing file descriptor

Parameters
xthe existing file descriptor

Member Function Documentation

void FD::report ( std::ostream &  s,
int  fd 
)
static

Report the details or status of a file descriptor.

Parameters
sthe stream to write to
fdthe file descriptor to examine.

The documentation for this class was generated from the following files: