Enumerations | |
| enum | TimeZone { DLR_TZ_GMT, DLR_TZ_LOCAL } |
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 () |
| This function returns the preferred path delimiter for the operating system. | |
| const std::vector< std::string > & | pathDelimiters () |
| This function returns a vector of strings containing all of the recognized path delimiters for the operating system. | |
| const std::string & | extensionDelimiter () |
| This function returns the string that separates a filename extension from the rest of the filename. | |
| 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. | |
| std::string | getISOTimeString (TimeZone tz=DLR_TZ_LOCAL) |
| This function returns the current time as a string in the format "YYYY-MM-DD HH:MM:SS.ss". | |
| void | portableSleep (double seconds) |
| This function causes the program to suspend execution for at least as many seconds as specified by its argument. | |
| const std::string & dlr::portability::extensionDelimiter | ( | ) |
This function returns the string that separates a filename extension from the rest of the filename.
On all operating systems so far, this delimiter is ".". For example, in the filename /foo/bar/baz.dat, the filename ("baz") is separated from the extension ("dat") by a single ".".
Definition at line 241 of file filesystem.cpp.
| 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.
Definition at line 106 of file timeUtilities.cpp.
| std::string dlr::portability::getISOTimeString | ( | TimeZone | tz = DLR_TZ_LOCAL |
) |
This function returns the current time as a string in the format "YYYY-MM-DD HH:MM:SS.ss".
| tz | This argument |
Definition at line 114 of file timeUtilities.cpp.
| 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.
| path | This argument is the filename to evaluate. |
Definition at line 59 of file filesystem.cpp.
| const std::string & dlr::portability::pathDelimiter | ( | ) |
This function returns the preferred path delimiter for the operating system.
For example, on Linux operating systems, it will return "/".
Definition at line 222 of file filesystem.cpp.
| const std::vector< std::string > & dlr::portability::pathDelimiters | ( | ) |
This function returns a vector of strings containing all of the recognized path delimiters for the operating system.
The first element of this vector will always be equal to the string by function pathDelimiter(). Some operating systems may use more than one path delimeter, and in this case, the vector will have more than one element. For example, on Windows, the returned vector has two elements: "\", and "/".
Definition at line 229 of file filesystem.cpp.
Referenced by splitPath().
| 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.
| seconds | This argument indicates how many seconds to sleep. |
Definition at line 145 of file timeUtilities.cpp.
Referenced by preciseSleep().
| 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.
| seconds | This argument indicates how many milliseconds to sleep. |
Definition at line 52 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/", ""}
Definition at line 99 of file filesystem.cpp.
References pathDelimiters().
1.5.8