DesktopFile.expandExecValue

Expand "Exec" value into the array of command line arguments to use to start the program. It applies unquoting and unescaping.

class DesktopFile
@safe const
string[]
expandExecValue
(
scope const(string)[] urls = null
,
string locale = null
)

Examples

        string contents =
`[Desktop Entry]
Name=Program
Name[ru]=Программа
Exec="quoted program" %i -w %c -f %k %U %D %u %f %F
Icon=folder
Icon[ru]=folder_ru`;
        auto df = new DesktopFile(iniLikeStringReader(contents), "/example.desktop");
        assert(df.expandExecValue(["one", "two"], "ru") ==
        ["quoted program", "--icon", "folder_ru", "-w", "Программа", "-f", "/example.desktop", "one", "two", "one", "one", "one", "two"]);
    

See Also

Meta