|
TPCCLIB
|
Functions for editing file names. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <time.h>#include <string.h>#include "tpcextensions.h"Go to the source code of this file.
Functions | |
| void | filenameRmPath (char *s) |
| void | filenameRmFile (char *s) |
| int | filenameRmExtension (char *s) |
| void | filenameRmExtensions (char *s) |
| int | fnmatch (const char *fname, const char *key) |
| int | fncasematch (const char *fname, const char *key) |
| char * | filenameGetExtension (const char *s) |
| Get the last extension of a file name. | |
| char * | filenameGetExtensions (const char *s) |
| Get all extensions of a file name. | |
Functions for editing file names.
Definition in file filename.c.
| char * filenameGetExtension | ( | const char * | s | ) |
Get the last extension of a file name.
Extension(s) in pathname are not searched for. Note that pointer points to the original string.
| s | Pointer to string; string is not edited here. |
Definition at line 178 of file filename.c.
Referenced by abssIdFromFName(), imgWriteNifti(), micropetExists(), niftiBasename(), and tacRead().
| char * filenameGetExtensions | ( | const char * | s | ) |
Get all extensions of a file name.
Extension(s) in pathname are not searched for. Note that pointer points to the original string.
| s | Pointer to string; string is not edited here. |
Definition at line 203 of file filename.c.
Referenced by imgFormatFromFName(), and parFormatFromExtension().
| int filenameRmExtension | ( | char * | s | ) |
Remove the last extension from file name.
| s | Pointer to string. |
Definition at line 71 of file filename.c.
Referenced by filenameRmExtensions(), micropetExists(), tpcHtmlUsage(), tpcPrintBuild(), tpcPrintUsage(), and tpcProgramName().
| void filenameRmExtensions | ( | char * | s | ) |
Remove all extensions from file name.
| s | Pointer to string. |
Definition at line 89 of file filename.c.
Referenced by studynrFromFilename().
| void filenameRmFile | ( | char * | s | ) |
Remove file name from file name string including path, leaving only path without trailing '/'. If there is no path, then result is ".". For root path the result string is empty. See also POSIX function dirname() in libgen.h.
| s | Pointer to string. |
Definition at line 44 of file filename.c.
Referenced by dcmFileList(), and imgWriteNifti().
| void filenameRmPath | ( | char * | s | ) |
Remove path from file name. See also POSIX function basename() in libgen.h.
| s | Pointer to string. |
Definition at line 20 of file filename.c.
Referenced by imgWriteNifti(), niftiCreateFNames(), studynrFromFilename(), tpcHtmlUsage(), tpcPrintBuild(), tpcPrintUsage(), and tpcProgramName().
| int fncasematch | ( | const char * | fname, |
| const char * | key ) |
Case-independent check whether string fname matches string key, which may contain wild-cards ? and *.
| fname | file name that is evaluated. |
| key | key string which may contain wild-cards '?' and '*'. |
Definition at line 139 of file filename.c.
Referenced by roinameMatch().
| int fnmatch | ( | const char * | fname, |
| const char * | key ) |
Check if string fname matches string key, which may contain wild cards * ? and *.
| fname | file name that is evaluated. |
| key | key string which may contain wild cards '?' and '*'. |
Definition at line 104 of file filename.c.
Referenced by fncasematch(), and fnmatch().