ldas-tools-al 2.6.4
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
LDASTools::AL::Directory Class Reference

Read the contents of a directory. More...

#include <Directory.hh>

Classes

class  Internals
 

Public Types

enum  mode_type { MODE_BLOCKING , MODE_NON_BLOCKING }
 Enumerated type specifying the blocking mode. More...
 
typedef std::list< std::string > block_read_type
 
typedef boost::shared_ptr< Internalsvalue_type
 

Public Member Functions

 Directory (const std::string &DirName, bool OpenDirectory=true)
 Constructor. More...
 
 ~Directory ()
 Destructor. More...
 
void Close ()
 Close the directory. More...
 
const char * EntryName () const
 
int Fd () const
 
const std::string & Name () const
 
mode_type Mode () const
 
void Mode (mode_type Mode)
 
bool Next ()
 
void Next (block_read_type &Entries)
 
void Open ()
 

Static Public Member Functions

static int Timeout ()
 Retrieve the number of seconds any one of the calls should take. More...
 
static void Timeout (int Value)
 Specify the number of seconds any one of the calls should take. More...
 

Private Member Functions

void eval_request (const int Request)
 

Private Attributes

value_type m_internals
 
mode_type m_blocking_mode
 

Detailed Description

Read the contents of a directory.

This provides a system independent interface to reading the the contents of a directory. It can operate in a blocking or non-blocking mode. By default, it operates in non-blocking mode.

Member Typedef Documentation

◆ block_read_type

typedef std::list< std::string > LDASTools::AL::Directory::block_read_type

◆ value_type

typedef boost::shared_ptr< Internals > LDASTools::AL::Directory::value_type

Member Enumeration Documentation

◆ mode_type

Enumerated type specifying the blocking mode.

This is used by the Mode method to specify the blocking mode the subsequent calls should operate in.

Enumerator
MODE_BLOCKING 

Blocking mode.

            When in blocking mode, calls made will operate in the
            current
            thread and return when the system call returns. 
MODE_NON_BLOCKING 

Non blocking mode.

            When in non-blocking mode, calls are done in a thread and
            given a specific amount of time in which to return.
            If they do not return within the alotted time, then
            an exception is thrown. 

Constructor & Destructor Documentation

◆ Directory()

LDASTools::AL::Directory::Directory ( const std::string &  DirName,
bool  OpenDirectory = true 
)

Constructor.

Construct a new instance of this object.

◆ ~Directory()

LDASTools::AL::Directory::~Directory ( )

Destructor.

Release resources back to the system.

Member Function Documentation

◆ Close()

void LDASTools::AL::Directory::Close ( )

Close the directory.

◆ EntryName()

const char * LDASTools::AL::Directory::EntryName ( ) const

◆ eval_request()

void LDASTools::AL::Directory::eval_request ( const int  Request)
inlineprivate

◆ Fd()

int LDASTools::AL::Directory::Fd ( ) const

◆ Mode() [1/2]

Directory::mode_type LDASTools::AL::Directory::Mode ( ) const
inline

◆ Mode() [2/2]

void LDASTools::AL::Directory::Mode ( mode_type  Mode)
inline

◆ Name()

const std::string & LDASTools::AL::Directory::Name ( ) const

◆ Next() [1/2]

bool LDASTools::AL::Directory::Next ( )

Retrieve the next entry. returns true if a valid entry was found, false otherwise

◆ Next() [2/2]

void LDASTools::AL::Directory::Next ( block_read_type Entries)

◆ Open()

void LDASTools::AL::Directory::Open ( )

◆ Timeout() [1/2]

int LDASTools::AL::Directory::Timeout ( )
static

Retrieve the number of seconds any one of the calls should take.

◆ Timeout() [2/2]

void LDASTools::AL::Directory::Timeout ( int  Value)
static

Specify the number of seconds any one of the calls should take.

Member Data Documentation

◆ m_blocking_mode

mode_type LDASTools::AL::Directory::m_blocking_mode
private

◆ m_internals

value_type LDASTools::AL::Directory::m_internals
private

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