The format of Shared MIME Database magic values
axill777 at gmail.com
Sun Dec 15 23:33:59 PST 2013
Thanks for the tip. However, i'm decided to write my own implementation. My
Python knowledge is very limited, but i'm take a look of your code later,
in winter holidays (they are so long in Russia).
It almost working now, except support for some data types: host16/32,
Am i correctly understand this current-machine endian, little-endian and
big-endian integer values of length 2 and 4 bytes?
About Windows support - you are right, it haven't all features of Unix
shared mime database. But it can be useful at least with searching of
registered extension list.
2013/12/14 Jerome Leclanche <adys.wh at gmail.com>
> There is a Qt 4 port of this.
> As for windows support... I've been down that road, trying to provide
> it. Windows' feature set doesn't even sort of come close; it only
> provides real mime types for a limited set of registered extensions,
> and it doesn't provide any of the very useful features such as
> subclassing, etc. In the end, I gave up and am only providing
> xdg-based mime types. I think Qt made an excellent choice in providing
> the xdg database itself. But if you choose against that, good luck.
> Anyway you can have a look at my python-based mimetype lib. Magic
> matches are implemented on line 192 onwards.
> J. Leclanche
> On Fri, Dec 13, 2013 at 7:56 PM, Alexander Kamyshnikov
> <axill777 at gmail.com> wrote:
> > Yes, i had. But i decided to write my own implementation because:
> > a) my project is forced to use Qt4 only (clients have very old versions
> > modified Red Hat with XDG_DATA_DIRS undefined);
> > b) Windows support (through reading registry HKCR/.ext keys) is required;
> > c) I'm very curious :)
> > You think i'm should look deeply at the qmimedatabase.cpp however?
> > 2013/12/13 Jerome Leclanche <adys.wh at gmail.com>
> >> 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
> >> > 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:
> >> >
> >> >
> >> > P.S. <match> items can be nested. But i can't find yet the clear way
> >> > implement their storage programmatically. Some kind of tree, or
> >> > polish notation should be used here? nevermind
> >> >
> >> > _______________________________________________
> >> > xdg mailing list
> >> > xdg at lists.freedesktop.org
> >> > http://lists.freedesktop.org/mailman/listinfo/xdg
> >> >
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the xdg