chsvlib
chsv helper source code

◆ AllocateUniqueTempFileNameA()

char* Chusov::String::AllocateUniqueTempFileNameA ( const char *  lpszExtension)
noexcept

Allocates and returns an absolute a unique file name based on UUID and that is to be located in the system temporary directory.

Parameters
[in]lpszExtensionis an optional string specifying an extension for the file name. If the parameter is NULL the file name is generated without extension.
Returns
On success the function returns an absolute path to a unique file that is to be located in the temporary directory returned by the AllocateTempPathA function. The file itself is not created, but only its name, which is based on UUID is returned. When the returned value is no longer needed, free the returned buffer using the FreeStringA, SecureFreeStringA or any other free function of the chsvmem.h header. If the function fails it returns NULL. Use GetLastChsvError to get extended error information.
Remarks
The string is returned in format "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.lpszExtension" plus the terminating zero as the last character.
The function does not try to create file or to check validity of its name.
See also
AllocateTempPathA;
FreeStringA;
AllocateStringA;
AllocateUniqueStringA;
AllocateAndFormatStringA.