Qore Magic Module  0.0.2
magic.dox.h
1 namespace Qore::Magic {
4 
18 class Magic {
19 
20 public:
22 
28 string buffer(data data);
29 
30 public:
32 
39 string buffer(data data, softint flags);
40 
41 public:
43 /***/
44  constructor();
45 
46 public:
48 
50  constructor(softint flags);
51 
52 public:
54 
60 string file(softstring fileName);
61 
62 public:
64 
71 string file(softstring fileName, softint flags);
72 
73 public:
75 
77  setFlags(softint flags);
78 };
82 
84  const MAGIC_APPLE = 0x000800;
86  const MAGIC_CHECK = 0x000040;
88  const MAGIC_COMPRESS = 0x000004;
90  const MAGIC_CONTINUE = 0x000020;
92  const MAGIC_DEBUG = 0x000001;
94  const MAGIC_DEVICES = 0x000008;
96  const MAGIC_ERROR = 0x000200;
98  const MAGIC_MIME = 0x000410;
100  const MAGIC_MIME_ENCODING = 0x000400;
102  const MAGIC_MIME_TYPE = 0x000010;
104  const MAGIC_NONE = 0x000000;
106  const MAGIC_NO_CHECK_APPTYPE = 0x008000;
108  const MAGIC_NO_CHECK_BUILTIN = 0x3fb000;
110  const MAGIC_NO_CHECK_CDF = 0x040000;
112  const MAGIC_NO_CHECK_COMPRESS = 0x001000;
114  const MAGIC_NO_CHECK_ELF = 0x010000;
116  const MAGIC_NO_CHECK_ENCODING = 0x200000;
118  const MAGIC_NO_CHECK_SOFT = 0x004000;
120  const MAGIC_NO_CHECK_TAR = 0x002000;
122  const MAGIC_NO_CHECK_TEXT = 0x020000;
124  const MAGIC_NO_CHECK_TOKENS = 0x100000;
126  const MAGIC_PRESERVE_ATIME = 0x000080;
128  const MAGIC_RAW = 0x000100;
130  const MAGIC_SYMLINK = 0x000002;
132 };
const MAGIC_MIME_ENCODING
Return the MIME encoding.
Definition: magic.dox.h:100
const MAGIC_COMPRESS
Check inside compressed files.
Definition: magic.dox.h:88
constructor()
Constructs a dummy.
const MAGIC_DEVICES
Look at the contents of devices.
Definition: magic.dox.h:94
const MAGIC_NO_CHECK_ENCODING
Don't check text encodings.
Definition: magic.dox.h:116
const MAGIC_NO_CHECK_APPTYPE
Don't check application type.
Definition: magic.dox.h:106
const MAGIC_NO_CHECK_TOKENS
Don't check tokens.
Definition: magic.dox.h:124
Qore::Magic namespace.
Definition: magic.dox.h:2
A low level wrapper around libmagic.
Definition: magic.dox.h:18
const MAGIC_ERROR
Handle ENOENT etc as real errors.
Definition: magic.dox.h:96
const MAGIC_APPLE
Return the Apple creator and type.
Definition: magic.dox.h:84
const MAGIC_CONTINUE
Return all matches.
Definition: magic.dox.h:90
const MAGIC_DEBUG
Turn on debugging.
Definition: magic.dox.h:92
const MAGIC_MIME_TYPE
Return the MIME type.
Definition: magic.dox.h:102
const MAGIC_RAW
Don't translate unprintable chars.
Definition: magic.dox.h:128
const MAGIC_NO_CHECK_ELF
Don't check for elf details.
Definition: magic.dox.h:114
const MAGIC_NO_CHECK_CDF
Don't check for cdf files.
Definition: magic.dox.h:110
const MAGIC_NO_CHECK_COMPRESS
Don't check for compressed files.
Definition: magic.dox.h:112
const MAGIC_PRESERVE_ATIME
Restore access time on exit.
Definition: magic.dox.h:126
const MAGIC_NO_CHECK_TAR
Don't check for tar files.
Definition: magic.dox.h:120
const MAGIC_CHECK
Print warnings to stderr.
Definition: magic.dox.h:86
string buffer(data data)
Returns magic info for a data buffer.
string file(softstring fileName)
Returns magic info for a file (path)
const MAGIC_NO_CHECK_SOFT
Don't check magic entries.
Definition: magic.dox.h:118
const MAGIC_NONE
No flags.
Definition: magic.dox.h:104
const MAGIC_NO_CHECK_TEXT
Don't check for text files.
Definition: magic.dox.h:122
const MAGIC_NO_CHECK_BUILTIN
No built-in tests only consult the magic file.
Definition: magic.dox.h:108
const MAGIC_MIME
Returns MIME type with encoding.
Definition: magic.dox.h:98
setFlags(softint flags)
Resets new flags/features based on libmagic Constants.
const MAGIC_SYMLINK
Follow symlinks.
Definition: magic.dox.h:130