STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

basic_current_directory_scope Class Template Reference
[File-System Library (UNIXSTL)]

Current directory scoping class. More...

#include <unixstl_current_directory_scope.h>

List of all members.

State

 operator operator_bool_type () const
 Indicates whether the construction was successful.


Public Types

typedef C char_type

Public Methods

 basic_current_directory_scope (char_type const *dir)
 Constructs a scope instance and changes to the given directory.

template<typename S>  basic_current_directory_scope (S const &dir)
 Constructs a scope instance and changes to the given directory.

 ~basic_current_directory_scope () unixstl_throw_0()
 Returns the current directory to its original location.

char_type const * get_previous () const
 Returns a C-string pointer to the original directory.

 operator char_type const * () const
 Returns a C-string pointer to the original directory.


Detailed Description

template<typename C, typename T = filesystem_traits<C>>
class unixstl::basic_current_directory_scope< C, T >

Current directory scoping class.

This class scopes the process's current directory, by changing to the path given in the constructor, and then, if that succeeded, changing back in the destructor

Parameters:
C  The character type (e.g. char, wchar_t)
T  The file-system traits. In translators that support default template parameters that defaults to filesystem_traits<C>


Member Typedef Documentation

typedef C char_type
 

The character type


Constructor & Destructor Documentation

basic_current_directory_scope char_type const *    dir [explicit]
 

Constructs a scope instance and changes to the given directory.

Parameters:
dir  The name of the directory to change the current directory to

basic_current_directory_scope S const &    dir [inline, explicit]
 

Constructs a scope instance and changes to the given directory.

Parameters:
dir  The name of the directory to change the current directory to

~basic_current_directory_scope  
 

Returns the current directory to its original location.


Member Function Documentation

char_type const* get_previous  
 

Returns a C-string pointer to the original directory.

operator char_type const *  
 

Returns a C-string pointer to the original directory.

operator operator_bool_type   const [inline]
 

Indicates whether the construction was successful.

Return values:
true  The scope instance was successfully constructed and the current directory changed as per the constructor argument
false  The scope instance was not successfully constructed, and the current directory was unchanged.


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

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004