DesktopFile.expandExecString

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[]
expandExecString
(
in 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), DesktopFile.ReadOptions.noOptions, "/example.desktop");
        assert(df.expandExecString(["one", "two"], "ru") == 
        ["quoted program", "--icon", "folder_ru", "-w", "Программа", "-f", "/example.desktop", "one", "two", "one", "one", "one", "two"]);
    

See Also

execString, unquoteExecString, unescapeExecArgument, startApplication

Meta