mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
scripted-diff: Make SeparatorStyle a scoped enum
-BEGIN VERIFY SCRIPT-
# General rename helper: $1 -> $2
rename_global() { sed -i "s/\<$1\>/$2/g" $(git grep -l "$1"); }
# Helper to rename SeparatorStyle enumerators
rename_value() {
sed -i "s/ $1/ $2/g" src/qt/bitcoinunits.h;
rename_global $1 "SeparatorStyle::$2";
}
rename_global 'enum SeparatorStyle' 'enum class SeparatorStyle'
rename_value 'separatorNever' 'NEVER'
rename_value 'separatorStandard' 'STANDARD'
rename_value 'separatorAlways' 'ALWAYS'
-END VERIFY SCRIPT-
This commit is contained in:
@@ -46,11 +46,11 @@ public:
|
||||
SAT
|
||||
};
|
||||
|
||||
enum SeparatorStyle
|
||||
enum class SeparatorStyle
|
||||
{
|
||||
separatorNever,
|
||||
separatorStandard,
|
||||
separatorAlways
|
||||
NEVER,
|
||||
STANDARD,
|
||||
ALWAYS
|
||||
};
|
||||
|
||||
//! @name Static API
|
||||
@@ -72,11 +72,11 @@ public:
|
||||
//! Number of decimals left
|
||||
static int decimals(int unit);
|
||||
//! Format as string
|
||||
static QString format(int unit, const CAmount& amount, bool plussign = false, SeparatorStyle separators = separatorStandard, bool justify = false);
|
||||
static QString format(int unit, const CAmount& amount, bool plussign = false, SeparatorStyle separators = SeparatorStyle::STANDARD, bool justify = false);
|
||||
//! Format as string (with unit)
|
||||
static QString formatWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
|
||||
static QString formatWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD);
|
||||
//! Format as HTML string (with unit)
|
||||
static QString formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
|
||||
static QString formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD);
|
||||
//! Format as string (with unit) of fixed length to preserve privacy, if it is set.
|
||||
static QString formatWithPrivacy(int unit, const CAmount& amount, SeparatorStyle separators, bool privacy);
|
||||
//! Parse string to coin amount
|
||||
|
||||
Reference in New Issue
Block a user