TrueReality  v0.1.1912
trUtil::DirectoryPush Class Reference

Simple class to change directory where it automatically pop back out on destruction. More...

#include <FileUtils.h>

Public Member Functions

 DirectoryPush (const std::string &dir)
 Constructor. More...
 
 ~DirectoryPush ()
 Destructor. More...
 
bool GetSucceeded ()
 Gets the succeeded. More...
 
const std::string & GetError ()
 Gets the error. More...
 

Private Attributes

bool mSucceeded
 
std::string mError
 

Detailed Description

Simple class to change directory where it automatically pop back out on destruction.

To be used on the stack.

Definition at line 695 of file FileUtils.h.

Constructor & Destructor Documentation

◆ DirectoryPush()

trUtil::DirectoryPush::DirectoryPush ( const std::string &  dir)

Constructor.

Parameters
dirThe dir.

Definition at line 1825 of file FileUtils.cpp.

References trUtil::FileUtils::GetInstance(), mError, mSucceeded, trUtil::FileUtils::PushDirectory(), and trUtil::Exception::ToString().

Here is the call graph for this function:

◆ ~DirectoryPush()

trUtil::DirectoryPush::~DirectoryPush ( )

Destructor.

Definition at line 1840 of file FileUtils.cpp.

References trUtil::FileUtils::GetInstance(), mSucceeded, and trUtil::FileUtils::PopDirectory().

Here is the call graph for this function:

Member Function Documentation

◆ GetError()

const std::string & trUtil::DirectoryPush::GetError ( )

Gets the error.

Returns
The error.

Definition at line 1855 of file FileUtils.cpp.

References mError.

◆ GetSucceeded()

bool trUtil::DirectoryPush::GetSucceeded ( )

Gets the succeeded.

Returns
True if it succeeds, false if it fails.

Definition at line 1849 of file FileUtils.cpp.

References mSucceeded.

Referenced by trUtil::FileUtils::GetAbsolutePath().

Here is the caller graph for this function:

Member Data Documentation

◆ mError

std::string trUtil::DirectoryPush::mError
private

Definition at line 734 of file FileUtils.h.

Referenced by DirectoryPush(), and GetError().

◆ mSucceeded

bool trUtil::DirectoryPush::mSucceeded
private

Definition at line 733 of file FileUtils.h.

Referenced by DirectoryPush(), GetSucceeded(), and ~DirectoryPush().


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