|
|
Determine auto-magically the type of file, not only by using its extension, but also by reading its contents.
Unless specified otherwise, KMimeMagic uses $KDEDIR/share/mimelnk/magic for this purpose.
The basic usage of KMimeMagic is :
find...Type()
methods.
The result is contained in the class KMimeMagicResult.
|
Create a parser and initialize it with the given config file.
~ |
Destroy the parser.
bool |
Merge an existing parse table with the data from the given file.
Returns: true
on success.
bool |
Merge an existing parse table with the data from the given buffer.
Returns: true
on success.
void |
Enable/Disable follow-links.
(Default is disabled.)
KMimeMagicResult* |
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.
Returns: A pointer to the result object. Do not delete the result object. After another call to KMimeMagic the returned result object changes its value since it is reused by KMimeMagic.
KMimeMagicResult* |
Same functionality as above, except data is not read from a file.
Instead a buffer can be supplied which is examined. The integer parameter supplies the length of the buffer.
Returns: A pointer to the result object. Do not delete the result object. After another call to KMimeMagic the returned result object changes its value since it is reused by KMimeMagic.
KMimeMagicResult * |
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.
Returns: A pointer to the result object. Do not delete the result object. After another call to KMimeMagic the returned result object changes its value since it is reused by KMimeMagic.
KMimeMagic* |
[static]
Returns a pointer to the unique KMimeMagic instance in this process.
KMimeMagicResult * |
[protected]
The result type.
void |
[protected static]
static KMimeMagic* |
[protected]
Generated by: baudens@ke.mandrakesoft.com on Thu Oct 26 17:36:34 2000, using kdoc 2.0a40. |