A class for automatically creating unique pseudo-random filenames.
More...
|
|
| OFFilenameCreator () |
| | default constructor
|
| |
|
| OFFilenameCreator (const OFFilenameCreator ©) |
| | copy constructor
|
| |
|
virtual | ~OFFilenameCreator () |
| | destructor
|
| |
|
OFFilenameCreator & | operator= (const OFFilenameCreator ©) |
| | assignment operator
|
| |
| OFBool | makeFilename (unsigned int &seed, const char *dir, const char *prefix, const char *postfix, OFString &filename) |
| | creates a new unique filename.
|
| |
|
| static unsigned int | hashString (const char *str) |
| | creates hash value.
|
| |
|
| static void | addLongToString (unsigned long l, OFString &s) |
| | appends the lower 32 bit of the given number to the given string.
|
| |
|
|
unsigned long | creation_time |
| | date/time of creation of this object
|
| |
A class for automatically creating unique pseudo-random filenames.
◆ addLongToString()
| static void OFFilenameCreator::addLongToString |
( |
unsigned long | l, |
|
|
OFString & | s ) |
|
staticprivate |
appends the lower 32 bit of the given number to the given string.
Always appends exactly 8 digits (padded with leading zeros).
- Parameters
-
| l | number to be appended to string |
| s | string to be added to |
◆ hashString()
| static unsigned int OFFilenameCreator::hashString |
( |
const char * | str | ) |
|
|
static |
creates hash value.
(i.e. random seed) from character string.
- Parameters
-
| str | null-terminated string |
- Returns
- hash value
◆ makeFilename()
| OFBool OFFilenameCreator::makeFilename |
( |
unsigned int & | seed, |
|
|
const char * | dir, |
|
|
const char * | prefix, |
|
|
const char * | postfix, |
|
|
OFString & | filename ) |
creates a new unique filename.
- Parameters
-
| seed | seed of random number generator |
| dir | directory in which the file name should be located |
| prefix | filename prefix |
| postfix | filename postfix |
| filename | string in which the filename (path) is returned |
- Returns
- OFTrue if successful, OFFalse if no filename could be created.
The documentation for this class was generated from the following file:
- ofstd/include/dcmtk/ofstd/offname.h