KMacroExpander
Enumerations | |
enum | Quoting { noquote , singlequote , doublequote , dollarquote , paren , subst , group , math } |
Functions | |
QString | expandMacros (const QString &ostr, const QHash< QString, QStringList > &map, QChar c) |
QString | expandMacros (const QString &str, const QHash< QChar, QString > &map, QChar c=QLatin1Char('%')) |
QString | expandMacros (const QString &str, const QHash< QChar, QStringList > &map, QChar c=QLatin1Char('%')) |
QString | expandMacros (const QString &str, const QHash< QString, QString > &map, QChar c=QLatin1Char('%')) |
QString | expandMacrosShellQuote (const QString &ostr, const QHash< QString, QStringList > &map, QChar c) |
QString | expandMacrosShellQuote (const QString &str, const QHash< QChar, QString > &map, QChar c=QLatin1Char('%')) |
QString | expandMacrosShellQuote (const QString &str, const QHash< QChar, QStringList > &map, QChar c=QLatin1Char('%')) |
QString | expandMacrosShellQuote (const QString &str, const QHash< QString, QString > &map, QChar c=QLatin1Char('%')) |
Detailed Description
A group of functions providing macro expansion (substitution) in strings, optionally with quoting appropriate for shell execution.
Enumeration Type Documentation
◆ Quoting
enum KMacroExpander::Quoting |
Definition at line 18 of file kmacroexpander_unix.cpp.
Function Documentation
◆ expandMacros() [1/4]
KCOREADDONS_EXPORT QString KMacroExpander::expandMacros | ( | const QString & | ostr, |
const QHash< QString, QStringList > & | map, | ||
QChar | c ) |
Definition at line 369 of file kmacroexpander.cpp.
◆ expandMacros() [2/4]
KCOREADDONS_EXPORT QString KMacroExpander::expandMacros | ( | const QString & | str, |
const QHash< QChar, QString > & | map, | ||
QChar | c = QLatin1Char('%') ) |
Perform safe macro expansion (substitution) on a string.
The escape char must be quoted with itself to obtain its literal representation in the resulting string.
- Parameters
-
str The string to expand map map with substitutions c escape char indicating start of macro, or QChar::null if none
- Returns
- the string with all valid macros expanded
Definition at line 345 of file kmacroexpander.cpp.
◆ expandMacros() [3/4]
KCOREADDONS_EXPORT QString KMacroExpander::expandMacros | ( | const QString & | ostr, |
const QHash< QChar, QStringList > & | map, | ||
QChar | c ) |
Same as above, except that the macros expand to string lists that are simply join(" ")ed together.
Definition at line 361 of file kmacroexpander.cpp.
◆ expandMacros() [4/4]
KCOREADDONS_EXPORT QString KMacroExpander::expandMacros | ( | const QString & | str, |
const QHash< QString, QString > & | map, | ||
QChar | c = QLatin1Char('%') ) |
Perform safe macro expansion (substitution) on a string.
The escape char must be quoted with itself to obtain its literal representation in the resulting string. Macro names can consist of chars in the range [A-Za-z0-9_]; use braces to delimit macros from following words starting with these chars, or to use other chars for macro names.
- Parameters
-
str The string to expand map map with substitutions c escape char indicating start of macro, or QChar::null if none
- Returns
- the string with all valid macros expanded
Definition at line 353 of file kmacroexpander.cpp.
◆ expandMacrosShellQuote() [1/4]
KCOREADDONS_EXPORT QString KMacroExpander::expandMacrosShellQuote | ( | const QString & | ostr, |
const QHash< QString, QStringList > & | map, | ||
QChar | c ) |
Definition at line 373 of file kmacroexpander.cpp.
◆ expandMacrosShellQuote() [2/4]
KCOREADDONS_EXPORT QString KMacroExpander::expandMacrosShellQuote | ( | const QString & | str, |
const QHash< QChar, QString > & | map, | ||
QChar | c = QLatin1Char('%') ) |
Perform safe macro expansion (substitution) on a string for use in shell commands.
The escape char must be quoted with itself to obtain its literal representation in the resulting string.
- Parameters
-
str The string to expand map map with substitutions c escape char indicating start of macro, or QChar::null if none
- Returns
- the string with all valid macros expanded, or a null string if a shell syntax error was detected in the command
Definition at line 349 of file kmacroexpander.cpp.
◆ expandMacrosShellQuote() [3/4]
KCOREADDONS_EXPORT QString KMacroExpander::expandMacrosShellQuote | ( | const QString & | str, |
const QHash< QChar, QStringList > & | map, | ||
QChar | c = QLatin1Char('%') ) |
Same as above, except that the macros expand to string lists.
If the macro appears inside a quoted string, the list is simply join(" ")ed together; otherwise every element expands to a separate quoted string.
Definition at line 365 of file kmacroexpander.cpp.
◆ expandMacrosShellQuote() [4/4]
KCOREADDONS_EXPORT QString KMacroExpander::expandMacrosShellQuote | ( | const QString & | str, |
const QHash< QString, QString > & | map, | ||
QChar | c = QLatin1Char('%') ) |
Perform safe macro expansion (substitution) on a string for use in shell commands.
See KMacroExpanderBase::expandMacrosShellQuote() for the exact semantics. The escape char must be quoted with itself to obtain its literal representation in the resulting string. Macro names can consist of chars in the range [A-Za-z0-9_]; use braces to delimit macros from following words starting with these chars, or to use other chars for macro names.
- Parameters
-
str The string to expand map map with substitutions c escape char indicating start of macro, or QChar::null if none
- Returns
- the string with all valid macros expanded, or a null string if a shell syntax error was detected in the command
Definition at line 357 of file kmacroexpander.cpp.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.