ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
Directory Class Reference

A [std::vector] for directory entries. More...

#include <directory.h>

Inheritance diagram for Directory:

Public Types

enum  Options : char { None = 0, ParentDir = 1, OwnDir = 2, BothDir = 3 }
 

Public Member Functions

 Directory ()
 Standardconstructor. More...
 
 Directory (const FileName &path, Options options=Options::None, char letter=0)
 Constructor to scan immediately. More...
 
 ~Directory () ROLAND_DEFAULT void scan(const FileName &path
 Standarddestructor. More...
 
void sort ()
 
*void sort (bool casesensitive)
 
const FileNamepath ()
 Returns the current path of the Directory. More...
 

Public Attributes

Options options = Options::None
 
Options char letter = 0)
 

Private Attributes

FileName mDirName
 

Detailed Description

A [std::vector] for directory entries.

This is a vector to retrieve, store and sort FileName types. No slicing can occure by passing pointers of Directorys, because no additional variables are added at all.

Todo:

excludeflag for hidden files !!

maybe use a set rather than a vector, to sort entries this is needed in FileName : bool operator<(const ... & right) const {return mTestOffset > right.mTestOffset;}

Example:

Author
Fred Klaus

Member Enumeration Documentation

enum Options : char
Enumerator
None 
ParentDir 
OwnDir 
BothDir 

Constructor & Destructor Documentation

Directory ( )
inline

Standardconstructor.

References letter, options, path(), ROLAND_DEFAULT, and ~Directory().

Directory ( const FileName path,
Options  options = Options::None,
char  letter = 0 
)

Constructor to scan immediately.

References b, FileName::base(), closedir(), letter, mDirName, NAME_MAX, opendir(), options, path(), and readdir().

~Directory ( ) const

Standarddestructor.

Scans the Directory specified by

Parameters
pathwith
optionsand first letter

Referenced by Directory().

Member Function Documentation

const FileName& path ( )
inline

Returns the current path of the Directory.

References mDirName.

Referenced by Directory(), and FileList::onKeyboard().

void sort ( )

Sorts this vector by filename. If you dont need to change the default behaviour (case insensitive), use this.

Todo:
implement dirsfirst flag

Referenced by FileList::FileList().

void sort ( bool  casesensitive)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Is NOT REALLY THREADSAFE because of using a static function in FileName.

Parameters
casesensitive= Sets whether sorting is case sensitive or not.
See also
static stk::FileName::setCaseSensitiveCompare

References FileName::setCaseSensitiveCompare().

Member Data Documentation

Options char letter = 0)

Referenced by Directory().

FileName mDirName
private

Referenced by Directory(), and path().

Options options = Options::None

Referenced by Directory().


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