Albert
Loading...
Searching...
No Matches
albert::detail::DesktopEntryParser Class Reference

#include <albert/desktopentryparser.h>

Detailed Description

Public Member Functions

 DesktopEntryParser (const QString &path)
 
QString getString (const QString &section, const QString &key) const
 Get and escape string according to spec.
 
QString getLocaleString (const QString &section, const QString &key)
 Get localestring according to spec.
 
QString getIconString (const QString &section, const QString &key)
 Get iconstring according to spec.
 
bool getBoolean (const QString &section, const QString &key)
 Get boolean according to spec.
 
double getNumeric (const QString &, const QString &)
 Get numeric according to spec.
 

Static Public Member Functions

static std::optional< QStringListsplitExec (const QString &s) noexcept
 Split an Exec string according to spec.
 

Constructor & Destructor Documentation

◆ DesktopEntryParser()

albert::detail::DesktopEntryParser::DesktopEntryParser ( const QString &  path)

Member Function Documentation

◆ getBoolean()

bool albert::detail::DesktopEntryParser::getBoolean ( const QString &  section,
const QString &  key 
)

Get boolean according to spec.

Values of type boolean must either be the string true or false.

Returns
The boolean of the key in section
Parameters
sectionThe section to get the value from
keyThe key to the value for
Exceptions
out_of_rangeif lookup failed

◆ getIconString()

QString albert::detail::DesktopEntryParser::getIconString ( const QString &  section,
const QString &  key 
)

Get iconstring according to spec.

Values of type iconstring are the names of icons; these may be absolute paths, or symbolic names for icons located using the algorithm described in the Icon Theme Specification. Such values are not user-displayable, and are encoded in UTF-8.

Returns
The iconstring of the key in section
Parameters
sectionThe section to get the value from
keyThe key to the value for
Exceptions
out_of_rangeif lookup failed

◆ getLocaleString()

QString albert::detail::DesktopEntryParser::getLocaleString ( const QString &  section,
const QString &  key 
)

Get localestring according to spec.

Values of type localestring are user displayable, and are encoded in UTF-8.

Returns
The localestring of the key in section
Parameters
sectionThe section to get the value from
keyThe key to the value for
Exceptions
out_of_rangeif lookup failed

◆ getNumeric()

double albert::detail::DesktopEntryParser::getNumeric ( const QString &  ,
const QString &   
)

Get numeric according to spec.

Values of type numeric must be a valid floating point number as recognized by the f specifier for scanf in the C locale.

Returns
The numeric of the key in section
Parameters
sectionThe section to get the value from
keyThe key to the value for
Exceptions
out_of_rangeif lookup failed

◆ getString()

QString albert::detail::DesktopEntryParser::getString ( const QString &  section,
const QString &  key 
) const

Get and escape string according to spec.

Values of type string may contain all ASCII characters except for control characters.

Returns
The escaped string of the key in section
Parameters
sectionThe section to get the value from
keyThe key to the value for
Exceptions
out_of_rangeif lookup failed

◆ splitExec()

static std::optional< QStringList > albert::detail::DesktopEntryParser::splitExec ( const QString &  s)
staticnoexcept

Split an Exec string according to spec.


The documentation for this class was generated from the following file: