Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

Repos::FileProvider Class Reference

constructs repository file names. More...

List of all members.

Public Member Functions

 FileProvider (const char *base_name, bool rev=false)
bool next ()
void reset ()
Source source () const
BufferString fileName () const
BufferString fileName (Source) const

Static Public Member Functions

static bool next (Source &, bool rev=false)

Protected Member Functions

void getFname (BufferString &, bool) const

Protected Attributes

const BufferString basenm_
Source cursource_
bool rev_

Detailed Description

constructs repository file names.

The basename is the name of a file in upper and lower case, e.g. UnitsOfMeasure.

Then the files to find are: Temp: temp stor dir (/tmp on unix), file "UnitsOfMeasure" Rel: Software (release) dir, data subdir, file "UnitsOfMeasure" Appl: Application setup dir, data subdir, file "UnitsOfMeasure" Data: survey data root, file ".unitsofmeasure" Survey: survey directory, file ".unitsofmeasure" User: home/user dir, .od subdir, file "unitsofmeasure"

The 'Temp' will not be visited by the 'next' iterator, it's more or less added for as an undef or initial value. When specifying reverse, the iterator will start at User.

Usage example:

Repos::FileProvider rfp( "UnitsOfMeasure" ) while ( rfp.next() ) addUnitsFromFile( rfp.fileName(), rfp.source() );


Constructor & Destructor Documentation

Repos::FileProvider::FileProvider ( const char *  base_name,
bool  rev = false 
) [inline]

Member Function Documentation

BufferString Repos::FileProvider::fileName (  )  const [inline]
BufferString Repos::FileProvider::fileName ( Source   )  const
void Repos::FileProvider::getFname ( BufferString ,
bool   
) const [protected]
bool Repos::FileProvider::next (  )  [inline]
static bool Repos::FileProvider::next ( Source ,
bool  rev = false 
) [static]
void Repos::FileProvider::reset (  )  [inline]
Source Repos::FileProvider::source (  )  const [inline]

Member Data Documentation

bool Repos::FileProvider::rev_ [protected]