#include <kmimemagic.h>
Public Methods | |
| KMimeMagic () | |
| KMimeMagic (const QString &configFile) | |
| ~KMimeMagic () | |
| bool | mergeConfig (const QString &configFile) |
| bool | mergeBufConfig (char *) |
| void | setFollowLinks (bool _enable) |
| KMimeMagicResult * | findFileType (const QString &_filename) |
| KMimeMagicResult * | findBufferType (const QByteArray &p) |
| KMimeMagicResult * | findBufferFileType (const QByteArray &, const QString &filename) |
Static Public Methods | |
| KMimeMagic * | self () |
Protected Attributes | |
| KMimeMagicResult * | magicResult |
Unless specified otherwise, KMimeMagic uses $KDEDIR/share/mimelnk/magic for this purpose.
To make KMimeMagic restore the 'atime' of a file after it opened it, add its directory in kmimemagicrc like: [Settings] atimeDirs=/tmp,/var/tmp,/home/dfaure/tmp This isn't done by default because it changes the 'ctime'. See kmimemagic.cpp for a full discussion on this issue.
The basic usage of KMimeMagic is :
find...Type() methods.
Definition at line 100 of file kmimemagic.h.
|
|
Create a parser and initialize it with the KDE-global data: the "magic" config file as well as the snippets from share/config/magic.
|
|
|
Create a parser and initialize it with the given config file. |
|
|
Destroy the parser. |
|
||||||||||||
|
Same functionality as findBufferType() but with additional capability of distinguishing between C-headers and C-Source. For this purpose this function looks at the extension of the filename. This means that 'filename' can be a filename on some FTP server, too.
|
|
|
Same functionality as above, except data is not read from a file. Instead a buffer can be supplied which is examined.
|
|
|
Try to find a MimeType for the given file. If no special MimeType is found, the default MimeType is returned. This function looks at the content of the file.
|
|
|
Merge an existing parse table with the data from the given buffer.
|
|
|
Merge an existing parse table with the data from the given file.
|
|
|
Returns a pointer to the unique KMimeMagic instance in this process. |
|
|
Enable/Disable follow-links. (Default is disabled.) |
|
|
The result type. Definition at line 196 of file kmimemagic.h. |
1.2.18