Qore Magic Module
0.0.2
|
A low level wrapper around libmagic. More...
#include <magic.dox.h>
Public Member Functions | |
string | buffer (data data) |
Returns magic info for a data buffer. More... | |
string | buffer (data data, softint flags) |
Returns magic info for a data buffer. More... | |
constructor () | |
Constructs a dummy. More... | |
constructor (softint flags) | |
Constructs specialized instance. More... | |
string | file (softstring fileName) |
Returns magic info for a file (path) More... | |
string | file (softstring fileName, softint flags) |
Returns magic info for a file (path) More... | |
setFlags (softint flags) | |
Resets new flags/features based on libmagic Constants. More... | |
A low level wrapper around libmagic.
Example of use:
Resulting in:
"inode/symlink; charset=binary"
string Qore::Magic::Magic::buffer | ( | data | data | ) |
Returns magic info for a data buffer.
data | a data to file to be examined |
string | a text with requested info |
string Qore::Magic::Magic::buffer | ( | data | data, |
softint | flags | ||
) |
Returns magic info for a data buffer.
data | a data to file to be examined |
flags | settings flags |
string | a text with requested info |
Qore::Magic::Magic::constructor | ( | ) |
Constructs a dummy.
Qore::Magic::Magic::constructor | ( | softint | flags | ) |
Constructs specialized instance.
flags | features set based on libmagic Constants |
string Qore::Magic::Magic::file | ( | softstring | fileName | ) |
Returns magic info for a file (path)
fileName | a path to file to be examined |
string | a text with requested info |
string Qore::Magic::Magic::file | ( | softstring | fileName, |
softint | flags | ||
) |
Returns magic info for a file (path)
fileName | a path to file to be examined |
flags | settings flags |
string | a text with requested info |
Qore::Magic::Magic::setFlags | ( | softint | flags | ) |
Resets new flags/features based on libmagic Constants.
flags | New flags to replace old settings. |