mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support alternative values in string expansion
- syntax as per Bourne/Korn shell
${parameter:+altValue}
If parameter is unset or null, nothing is substituted.
Otherwise the \c altValue is substituted.
This commit is contained in:
@ -62,6 +62,13 @@ namespace stringOps
|
||||
// If parameter is unset or null, the \c defValue is substituted.
|
||||
// Otherwise, the value of parameter is substituted.
|
||||
//
|
||||
// Supports alternative values as per the Bourne/Korn shell.
|
||||
// \code
|
||||
// "${parameter:+altValue}"
|
||||
// \endcode
|
||||
// If parameter is unset or null, nothing is substituted.
|
||||
// Otherwise the \c altValue is substituted.
|
||||
//
|
||||
// Any unknown entries are removed silently.
|
||||
//
|
||||
// Malformed entries (eg, brace mismatch, sigil followed by bad character)
|
||||
@ -89,6 +96,13 @@ namespace stringOps
|
||||
// If parameter is unset or null, the \c defValue is substituted.
|
||||
// Otherwise, the value of parameter is substituted.
|
||||
//
|
||||
// Supports alternative values as per the Bourne/Korn shell.
|
||||
// \code
|
||||
// "${parameter:+altValue}"
|
||||
// \endcode
|
||||
// If parameter is unset or null, nothing is substituted.
|
||||
// Otherwise the \c altValue is substituted.
|
||||
//
|
||||
// Any unknown entries are removed silently.
|
||||
//
|
||||
// Malformed entries (eg, brace mismatch, sigil followed by bad character)
|
||||
@ -155,6 +169,13 @@ namespace stringOps
|
||||
// If parameter is unset or null, the \c defValue is substituted.
|
||||
// Otherwise, the value of parameter is substituted.
|
||||
//
|
||||
// Supports alternative values as per the Bourne/Korn shell.
|
||||
// \code
|
||||
// "${parameter:+altValue}"
|
||||
// \endcode
|
||||
// If parameter is unset or null, nothing is substituted.
|
||||
// Otherwise the \c altValue is substituted.
|
||||
//
|
||||
// Any unknown entries are removed silently, if allowEmpty is true.
|
||||
//
|
||||
// Malformed entries (eg, brace mismatch, sigil followed by bad character)
|
||||
@ -187,6 +208,13 @@ namespace stringOps
|
||||
// If parameter is unset or null, the \c defValue is substituted.
|
||||
// Otherwise, the value of parameter is substituted.
|
||||
//
|
||||
// Supports alternative values as per the Bourne/Korn shell.
|
||||
// \code
|
||||
// "${parameter:+altValue}"
|
||||
// \endcode
|
||||
// If parameter is unset or null, nothing is substituted.
|
||||
// Otherwise the \c altValue is substituted.
|
||||
//
|
||||
// Any unknown entries are removed silently, if allowEmpty is true.
|
||||
//
|
||||
// Malformed entries (eg, brace mismatch, sigil followed by bad character)
|
||||
|
||||
Reference in New Issue
Block a user