[][src]Crate freedesktop_entry_parser

A library for parsing FreeDesktop entry files. These files are used in the Desktop Entry and Icon Theme. They are similar to ini files but are distinct enough that an ini parse would not work.

Example:

use freedesktop_entry_parser::*;

let file = b"[Desktop Entry]
Name=Firefox
Exec=firefox %u
Icon=firefox";

assert_eq!(parse_entry(file).next().unwrap()?, SectionBytes {
    title: b"Desktop Entry",
    attrs: vec![
        AttrBytes { name: b"Name", value: b"Firefox"},
        AttrBytes { name: b"Exec", value: b"firefox %u"},
        AttrBytes { name: b"Icon", value: b"firefox"},
    ]
});

Structs

AttrBytes

A name and value pair from a SectionBytes

EntryIter

An iterator over the sections in a entry file. Returns SectionBytes

Error

The Error type, a wrapper around a dynamic error type.

SectionBytes

One section on a entry file

Functions

parse_entry

Parse a FreeDesktop entry file. Returns and iterator over the sections in the file.