Public Member Functions | Private Attributes | Static Private Attributes | List of all members
PLMD::Tools::DirectoryChanger Class Reference

Tiny class that changes directory and comes back when going out of scope. More...

#include <Tools.h>

Public Member Functions

 DirectoryChanger (const char *path)
 
 ~DirectoryChanger ()
 

Private Attributes

char cwd [buffersize] = {0}
 

Static Private Attributes

static const std::size_t buffersize =4096
 

Detailed Description

Tiny class that changes directory and comes back when going out of scope.

In case system calls to change dir are not available it throws an exception.

Warning
By construction, changing directory breaks thread safety! Use with care.

Constructor & Destructor Documentation

◆ DirectoryChanger()

PLMD::Tools::DirectoryChanger::DirectoryChanger ( const char *  path)
explicit

◆ ~DirectoryChanger()

PLMD::Tools::DirectoryChanger::~DirectoryChanger ( )

Member Data Documentation

◆ buffersize

const std::size_t PLMD::Tools::DirectoryChanger::buffersize =4096
staticprivate

◆ cwd

char PLMD::Tools::DirectoryChanger::cwd[buffersize] = {0}
private

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