YGP::IDirectorySearch Class Reference

Abstract baseclass providing an interface for classes to search in directory-structures. More...

Inherited by YGP::DirectorySearch, and YGP::RemoteDirSearch.

List of all members.

Public Member Functions

 IDirectorySearch ()
virtual ~IDirectorySearch ()
virtual void setSearchValue (const std::string &search)=0
std::string getSearchValue () const
virtual std::string getDirectory () const =0
virtual std::string getFileSpec () const =0
virtual bool isValid () const =0
Searching
virtual const Filefind (unsigned long attribs=FILE_NORMAL)=0
virtual const Filenext ()=0

Static Public Member Functions

static bool isSpecial (const char *pFile)
static unsigned long convertToSysAttribs (unsigned long attributes)
static unsigned long convertFromSysAttribs (unsigned long attributes)

Static Public Attributes

static const int FILE_NORMAL = 1
static const int FILE_READONLY = 2
static const int FILE_DIRECTORY = 4
static const int FILE_HIDDEN = 8

Protected Member Functions

void clearEntry ()

Protected Attributes

FilepEntry


Detailed Description

Abstract baseclass providing an interface for classes to search in directory-structures.

The following attributes are supported for files:


Constructor & Destructor Documentation

YGP::IDirectorySearch::IDirectorySearch (  )  [inline]

Default constructor.

YGP::IDirectorySearch::~IDirectorySearch (  )  [virtual]

Destructor.


Member Function Documentation

void YGP::IDirectorySearch::clearEntry (  )  [inline, protected]

Frees the buffer holding the last found file.

unsigned long YGP::IDirectorySearch::convertFromSysAttribs ( unsigned long  attribs  )  [static]

Converts the attributes as used by the system into attributes used by IDirectorySearch (as defined at the top).

Parameters:
attribs Attributes to convert
Returns:
unsigned long Attributes according to IDirectorySearch

unsigned long YGP::IDirectorySearch::convertToSysAttribs ( unsigned long  attribs  )  [static]

Converts attributes according to IDirectorySearch (as defined at the top) into values used by the system.

Parameters:
attribs Attributes to convert
Returns:
unsigned long Systemattributes

virtual const File* YGP::IDirectorySearch::find ( unsigned long  attribs = FILE_NORMAL  )  [pure virtual]

Method to start a find the files previously specified.

Additonally the files returned must match the passed attributes.

To be implemented by derived classes.

Returns:
const File* Pointer to found file or NULL

Implemented in YGP::DirectorySearch, YGP::PathDirectorySearch, and YGP::RemoteDirSearch.

virtual std::string YGP::IDirectorySearch::getDirectory (  )  const [pure virtual]

Intended to return the directory part of the files to search for; to be implemented by derived classes.

Implemented in YGP::DirectorySearch, and YGP::RemoteDirSearch.

virtual std::string YGP::IDirectorySearch::getFileSpec (  )  const [pure virtual]

Intended to return the name/file part of the files to search for; to be implemented by derived classes.

Implemented in YGP::DirectorySearch, and YGP::RemoteDirSearch.

std::string YGP::IDirectorySearch::getSearchValue (  )  const [inline]

Returns the files to search for.

static bool YGP::IDirectorySearch::isSpecial ( const char *  pFile  )  [inline, static]

Checks if the passed file is a "special" file (the system directories `.

' and `..').

virtual bool YGP::IDirectorySearch::isValid (  )  const [pure virtual]

Intended to check if the previously set search values are valid (e.g.

the directory is valid, ...)

To be implemented by derived classes.

Returns:
True if values are OK, false otherwise

Implemented in YGP::DirectorySearch, and YGP::RemoteDirSearch.

virtual const File* YGP::IDirectorySearch::next (  )  [pure virtual]

Method to find the next file matching the previously specified values.

To be implemented by derived classes.

Returns:
const File* Pointer to found file or NULL

Implemented in YGP::DirectorySearch, YGP::PathDirectorySearch, and YGP::RemoteDirSearch.

virtual void YGP::IDirectorySearch::setSearchValue ( const std::string &  search  )  [pure virtual]

Intended to set the files to search for; to be implemented by derived classes.

Implemented in YGP::DirectorySearch, and YGP::RemoteDirSearch.


Member Data Documentation

const int YGP::IDirectorySearch::FILE_DIRECTORY = 4 [static]

The file is actually a directory.

Reimplemented in YGP::RemoteDirSearch.

const int YGP::IDirectorySearch::FILE_HIDDEN = 8 [static]

The file is "hidden" in normal use.

Reimplemented in YGP::RemoteDirSearch.

const int YGP::IDirectorySearch::FILE_NORMAL = 1 [static]

"Normal" file (e.g. no directory; no device, ...)

Reimplemented in YGP::RemoteDirSearch.

const int YGP::IDirectorySearch::FILE_READONLY = 2 [static]

File can not be altered/written to.

Reimplemented in YGP::RemoteDirSearch.

Pointer to (last) found File object.


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

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:27 2009 by doxygen 1.5.8