The format of Shared MIME Database magic values

Jerome Leclanche adys.wh at gmail.com
Fri Dec 13 11:44:37 PST 2013


Have you had a look at the Qt 5 mimetype module?

http://qt-project.org/doc/qt-5.0/qtcore/qmimedatabase.html
J. Leclanche


On Fri, Dec 13, 2013 at 7:35 PM, Alexander Kamyshnikov
<axill777 at gmail.com> wrote:
> Hi all!
> I'm developing the implementation of MIME database in C++/Qt for one
> commercial program (requirement managment tool, if one will be interested).
> So my question is: the format of magic values to compare file header data
> with is not specified exactly in the spec. I mean the magic/match/value
> attribute.
> What exactly mean those magic strings from
> /usr/share/mime/packages/freedesktop.org.xml from my Kubuntu?
> 1) "\1\9"
> 2) "\376\067\0\043"
> 3) "\x8AMNG\x0D\x0A\x1A\x0A"
> Second is looks like octal number in C notation, third - hexadecimal, but
> about first i'm not sure. It is just "usual" decimal value?
> What format exactly should use magic values?
> Thanks for your help. WBR, Alexander
>
> P.S. Spec i'm using living here:
> http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html#id2661973
> P.S. <match> items can be nested. But i can't find yet the clear way to
> implement their storage programmatically. Some kind of tree, or reverse
> polish notation should be used here? nevermind
>
> _______________________________________________
> xdg mailing list
> xdg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xdg
>


More information about the xdg mailing list