Table of Contents
zfile_GetExtDescriptionGet the file extension of a file name. Files
Function prototypebool zfile_GetExt(const char* lpFileName, ZSTR hResult); Arguments
Return valueFalse if no extension was found or if an error occurred, and true otherwise (with hResult containing the file extension, without the dot). CommentsMultiple extensions
If a file has multiple extensions, such as 'test.tar.gz', ExampleTaken from L3DTio_FI.DLL: ... // create a temp var to contain the file extension ZVAR hStr = zvar_Create(VarID_string); if(!hStr) return false; // get the file extension of lpFileName argument if(!zfile_GetExt(lpFileName, hStr)) { zvar_Delete(hStr); return false; } char FileExt[MAX_PATH]; // declare a char array, into which we'll put the file extension strcpy(FileExt, zstr_GetText(hStr)); zvar_Delete(hStr); // done with the temp string var, so delete ... Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|