Static methods for generating temporary file names and finding temporary file directories.
More...
#include <tpie/tempname.h>
Static methods for generating temporary file names and finding temporary file directories.
Definition at line 50 of file tempname.h.
static std::string tpie::tempname::get_actual_path |
( |
| ) |
|
|
static |
Return The actual path used for temporary files taking environment variables into account.
The path is the found by querying the following in order:
TPIE2 TPIE global temp dir as set using set_default_path from source:/trunk/tpie/tempname.h TPIE1 TPIE environment varables (currently AMI_SINGLE_DEVICE) OS2 OS specific environment variables (like TMPDIR/TMP) OS1 OS specific standard path (/tmp or /var/tmp on unices and some windows thing for windows)
- Returns
- A string containing the path.
static const std::string& tpie::tempname::get_default_base_name |
( |
| ) |
|
|
static |
static const std::string& tpie::tempname::get_default_extension |
( |
| ) |
|
|
static |
static const std::string& tpie::tempname::get_default_path |
( |
| ) |
|
|
static |
static std::string tpie::tempname::get_system_path |
( |
| ) |
|
|
static |
Get the default path for temporary files on the system.
static void tpie::tempname::set_default_base_name |
( |
const std::string & |
name | ) |
|
|
static |
Set default base name for temporary files.
- See also
- tpie_name
static void tpie::tempname::set_default_extension |
( |
const std::string & |
ext | ) |
|
|
static |
Set default extension for temporary files.
- See also
- tpie_name
static void tpie::tempname::set_default_path |
( |
const std::string & |
path, |
|
|
const std::string & |
subdir = "" |
|
) |
| |
|
static |
Sets the default temporary path.
- Parameters
-
path | The default path to use; this path must exist in the system. |
subdir | Subdirectory of the temporary path, will be created if it does not exist. |
static std::string tpie::tempname::tpie_dir_name |
( |
const std::string & |
post_base = "" , |
|
|
const std::string & |
dir = "" |
|
) |
| |
|
static |
Generate path for a new temporary directory.
The rules for the generated path are the same as tpie_name, except no file extension is added.
static std::string tpie::tempname::tpie_name |
( |
const std::string & |
post_base = "" , |
|
|
const std::string & |
dir = "" , |
|
|
const std::string & |
ext = "" |
|
) |
| |
|
static |
Generate path for a new temporary file.
The temporary file name consists of a base name, set using set_default_base_name and defaulting to "TPIE"; an optional post base name, given as parameter to tpie_name; and a random string of characters. The parts are joined with underscores, and a file extension, either given as parameter to tpie_name or to set_default_extension. If neither is used, "tpie" will be used as the extension.
This file name is suffixed a temporary directory passed as a parameter. If no temporary directory is passed, the directory reported by get_actual_path is used instead.
The path returned does not already exist on the filesystem.
static bool tpie::tempname::try_directory |
( |
const std::string & |
path, |
|
|
const std::string & |
subdir = "" |
|
) |
| |
|
static |
Tests whether a temporary path is usable for tpie.
- Parameters
-
path | The path to test |
subdir | Subdirectory of the temporary path, will be created if it does not exist. |
The documentation for this class was generated from the following file: