|
Wavelet and Image class library
1.3.2
|
#include <FileName.hh>
Public Member Functions | |
| FileName (char const *name) | |
| ~FileName (void) | |
| bool | isext (const char *ext) const |
| void | toext (const char *ext) |
| filetype | guess (void) const |
| const char * | guessedMimeType (void) const |
| char * | file (void) const |
| char * | dir (void) const |
| char * | base (void) const |
| char * | ext (void) const |
| bool | dos (void) const |
Private Member Functions | |
| void | guessext (void) |
Private Attributes | |
| char * | m_fname |
| char * | m_dirname |
| char * | m_basename |
| char * | m_extension |
| bool | m_isdos |
| filetype | m_ftype |
File names. This splits a DOS- or Unix-like filespec into its parts (dir, name without extension, extension) and guesses what kind of (image) file it is according to the (case insignificant) file extension.
Definition at line 30 of file FileName.hh.
| FileName::FileName | ( | char const * | name | ) |
Constructor. The file name is being set, and the filename is split into its bits. At last the file type is guessed.
| name | the file name |
| invalid_argument | the file name is a {NULL} pointer |
| FileName::~FileName | ( | void | ) |
Destructor. Releases allocated memory.
| char* FileName::base | ( | void | ) | const [inline] |
Return the basename without extension.
Definition at line 75 of file FileName.hh.
References m_basename.
| char* FileName::dir | ( | void | ) | const [inline] |
Return the directory name.
Definition at line 71 of file FileName.hh.
References m_dirname.
| bool FileName::dos | ( | void | ) | const [inline] |
Is it a DOS-like name?
Definition at line 83 of file FileName.hh.
References m_isdos.
| char* FileName::ext | ( | void | ) | const [inline] |
Return the file extension.
Definition at line 79 of file FileName.hh.
References m_extension.
| char* FileName::file | ( | void | ) | const [inline] |
Return the file name.
Definition at line 67 of file FileName.hh.
References m_fname.
| filetype FileName::guess | ( | void | ) | const [inline] |
Return the guessed type. No calculation is done here.
Definition at line 59 of file FileName.hh.
References m_ftype.
| const char* FileName::guessedMimeType | ( | void | ) | const |
Return a mime type for the guessed type.
| void FileName::guessext | ( | void | ) | [private] |
Guess the type. This sets the {m_ftype} variable.
| bool FileName::isext | ( | const char * | ext | ) | const |
Compares two extensions. The comparison is case insensitive.
| ext | the other extension |
| void FileName::toext | ( | const char * | ext | ) |
Set a new extension. This might be useful if we want to create an output file name.
| ext | the new extension |
char* FileName::m_basename [private] |
char* FileName::m_dirname [private] |
char* FileName::m_extension [private] |
char* FileName::m_fname [private] |
filetype FileName::m_ftype [private] |
The file type. This is guessed from the file's extension.
Definition at line 98 of file FileName.hh.
Referenced by guess().
bool FileName::m_isdos [private] |
Is it a DOS-like filespec? It is as soon as we find a backslash somewhere in it!
Definition at line 96 of file FileName.hh.
Referenced by dos().
1.7.6.1