mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support default values in string expansion
- syntax as per Bourne/Korn shell
${parameter:-defValue}
If parameter is unset or null, the \c defValue is substituted.
Otherwise, the value of parameter is substituted.
This commit is contained in:
@ -55,7 +55,17 @@ namespace stringOps
|
||||
// -# variables
|
||||
// - "$VAR", "${VAR}"
|
||||
//
|
||||
// Any unknown entries are removed
|
||||
// Supports default values as per the Bourne/Korn shell.
|
||||
// \code
|
||||
// "${parameter:-defValue}"
|
||||
// \endcode
|
||||
// If parameter is unset or null, the \c defValue is substituted.
|
||||
// Otherwise, the value of parameter is substituted.
|
||||
//
|
||||
// Any unknown entries are removed silently.
|
||||
//
|
||||
// Malformed entries (eg, brace mismatch, sigil followed by bad character)
|
||||
// are left as is.
|
||||
//
|
||||
// \note the leading sigil can be changed to avoid conflicts with other
|
||||
// string expansions
|
||||
@ -72,7 +82,17 @@ namespace stringOps
|
||||
// -# variables
|
||||
// - "$VAR", "${VAR}"
|
||||
//
|
||||
// Any unknown entries are removed
|
||||
// Supports default values as per the Bourne/Korn shell.
|
||||
// \code
|
||||
// "${parameter:-defValue}"
|
||||
// \endcode
|
||||
// If parameter is unset or null, the \c defValue is substituted.
|
||||
// Otherwise, the value of parameter is substituted.
|
||||
//
|
||||
// Any unknown entries are removed silently.
|
||||
//
|
||||
// Malformed entries (eg, brace mismatch, sigil followed by bad character)
|
||||
// are left as is.
|
||||
//
|
||||
// \note the leading sigil can be changed to avoid conflicts with other
|
||||
// string expansions
|
||||
@ -128,7 +148,18 @@ namespace stringOps
|
||||
// - leading "~user" : home directory for specified user
|
||||
// - leading "~OpenFOAM" : site/user OpenFOAM configuration directory
|
||||
//
|
||||
// Any unknown entries are removed silently if allowEmpty is true
|
||||
// Supports default values as per the Bourne/Korn shell.
|
||||
// \code
|
||||
// "${parameter:-defValue}"
|
||||
// \endcode
|
||||
// If parameter is unset or null, the \c defValue is substituted.
|
||||
// Otherwise, the value of parameter is substituted.
|
||||
//
|
||||
// Any unknown entries are removed silently, if allowEmpty is true.
|
||||
//
|
||||
// Malformed entries (eg, brace mismatch, sigil followed by bad character)
|
||||
// are left as is.
|
||||
//
|
||||
// \sa
|
||||
// Foam::findEtcFile
|
||||
string expand
|
||||
@ -149,7 +180,19 @@ namespace stringOps
|
||||
// - leading "~user" : home directory for specified user
|
||||
// - leading "~OpenFOAM" : site/user OpenFOAM configuration directory
|
||||
//
|
||||
// Any unknown entries are removed silently if allowEmpty is true
|
||||
// Supports default values as per the Bourne/Korn shell.
|
||||
// \code
|
||||
// "${parameter:-defValue}"
|
||||
// \endcode
|
||||
// If parameter is unset or null, the \c defValue is substituted.
|
||||
// Otherwise, the value of parameter is substituted.
|
||||
//
|
||||
// Any unknown entries are removed silently, if allowEmpty is true.
|
||||
//
|
||||
// Malformed entries (eg, brace mismatch, sigil followed by bad character)
|
||||
// are left as is.
|
||||
//
|
||||
// Any unknown entries are removed silently if allowEmpty is true.
|
||||
// \sa
|
||||
// Foam::findEtcFile
|
||||
string& inplaceExpand
|
||||
|
||||
Reference in New Issue
Block a user