Read mimeapps.list file.
Read MIME type associations from IniLikeReader, e.g. acquired from iniLikeFileReader or iniLikeStringReader.
Access "Added Associations" group.
Access "Desktop Applications" group.
Access "Removed Associations" group.
string content = `[Added Associations] text/plain=geany.desktop;kde4-kwrite.desktop; image/png=kde4-gwenview.desktop;gthumb.desktop; [Removed Associations] text/plain=libreoffice-writer.desktop; [Default Applications] text/plain=kde4-kate.desktop x-scheme-handler/http=chromium.desktop;iceweasel.desktop; `; auto mimeAppsList = new MimeAppsListFile(iniLikeStringReader(content)); assert(mimeAppsList.addedAssociations() !is null); assert(mimeAppsList.removedAssociations() !is null); assert(mimeAppsList.defaultApplications() !is null); assert(mimeAppsList.addedAssociations().appsForMimeType("text/plain").equal(["geany.desktop", "kde4-kwrite.desktop"])); assert(mimeAppsList.removedAssociations().appsForMimeType("text/plain").equal(["libreoffice-writer.desktop"])); assert(mimeAppsList.defaultApplications().appsForMimeType("x-scheme-handler/http").equal(["chromium.desktop", "iceweasel.desktop"]));
Class represenation of single mimeapps.list file containing information about MIME type associations and default applications.