dlr::portability Namespace Reference

This namespace contains as much of the platform-specific code as possible, making the other libraries more readable. More...


Functions

bool isDirectory (const std::string &path)
 This function returns a bool indicating whether or not the specified path is a directory.
std::string joinPath (const std::string &part0, const std::string &part1)
std::pair< std::string, std::string > splitPath (const std::string &path)
 This function accepts a path returns a pair of strings in which the first element is the directory name and the second is the filename.
const std::string & pathDelimiter ()
const std::string & extensionDelimiter ()
std::vector< std::string > listDirectory (const std::string &directoryName, bool fullPath)
int snprintf (char *targetPtr, size_t targetSize, const char *formatPtr,...)
void preciseSleep (int milliseconds)
 This function causes the program to suspend execution for at least as many milliseconds as specified by its argument.
double getCurrentTime ()
 This function returns the current time as a double, the number of seconds since some significant (and OS dependent) event in the distant past.
void portableSleep (double seconds)
 This function causes the program to suspend execution for at least as many seconds as specified by its argument.


Detailed Description

This namespace contains as much of the platform-specific code as possible, making the other libraries more readable.

Function Documentation

double dlr::portability::getCurrentTime (  ) 

This function returns the current time as a double, the number of seconds since some significant (and OS dependent) event in the distant past.

Returns:
The return value is a double indicating the current time.

Definition at line 105 of file timeUtilities.cpp.

Referenced by dlr::utilities::FrequencyGoverner::isFinished(), dlr::thread::DistributionQueue< Type >::lockBack(), dlr::utilities::LockFile::LockFile(), dlr::random::PseudoRandom::PseudoRandom(), and dlr::utilities::FrequencyGoverner::sleepIfNecessary().

bool dlr::portability::isDirectory ( const std::string &  path  ) 

This function returns a bool indicating whether or not the specified path is a directory.

If the path is a symbolic link, the return value is currently unspecified, but will eventually be true iff the link points to a directory.

Parameters:
path This argument is the filename to evaluate.
Returns:
The return value is true if path refers to a directory, false otherwise.

Definition at line 59 of file filesystem.cpp.

Referenced by dlr::utilities::isDirectory().

void dlr::portability::portableSleep ( double  seconds  ) 

This function causes the program to suspend execution for at least as many seconds as specified by its argument.

The resolution of the timer is implimentation dependent, will always be some small fraction of a second.

Parameters:
seconds This argument indicates how many seconds to sleep.

Definition at line 113 of file timeUtilities.cpp.

Referenced by dlr::utilities::LockFile::LockFile(), preciseSleep(), and dlr::utilities::FrequencyGoverner::sleepIfNecessary().

void dlr::portability::preciseSleep ( int  milliseconds  ) 

This function causes the program to suspend execution for at least as many milliseconds as specified by its argument.

As with portableSleep(), the resolution of the timer is implimentation dependent.

Parameters:
seconds This argument indicates how many milliseconds to sleep.

Definition at line 51 of file timeUtilities.cpp.

References portableSleep().

std::pair< std::string, std::string > dlr::portability::splitPath ( const std::string &  path  ) 

This function accepts a path returns a pair of strings in which the first element is the directory name and the second is the filename.

For example:

splitPath("/foo/bar.baz")

might return

{"/foo/", "bar.baz"}

Also,

splitPath("bar.baz")

might return

{"", "bar.baz"}

splitPath("/foo/")

might return

{"/foo/", ""}

Returns:
The return value is a pair containing first the directory name, and second the file name.

Definition at line 99 of file filesystem.cpp.

References pathDelimiter().

Referenced by dlr::utilities::splitPath().


Generated on Mon Jul 9 20:34:22 2007 for dlrLibs Utility Libraries by  doxygen 1.5.2