@@ -57,30 +57,40 @@ class ConfigToString {
57
57
}
58
58
59
59
void boolean (const char8_t * key, auto && /* valueSetter */ , auto && valueGetter) noexcept
60
+ {
61
+ writeBool (key, valueGetter ());
62
+ }
63
+
64
+ void uint (const char8_t * key, auto && /* valueSetter */ , auto && valueGetter) noexcept
65
+ {
66
+ writeUint (key, valueGetter ());
67
+ }
68
+
69
+ private:
70
+ void writeBool (const char8_t * key, bool value) noexcept
60
71
{
61
72
if (shouldWriteMe ()) {
62
73
const auto previousWriteIndex = writeIndex;
63
- if (writeCommaAfterPreviousElement () && writeKey (key) && writeBool (valueGetter () ))
74
+ if (writeCommaAfterPreviousElement () && writeKey (key) && writeBool (value ))
64
75
increaseConversionIndexInNestingLevel ();
65
76
else
66
77
writeIndex = previousWriteIndex;
67
78
}
68
79
increaseIndexInNestingLevel ();
69
80
}
70
81
71
- void uint (const char8_t * key, auto && /* valueSetter */ , auto && valueGetter ) noexcept
82
+ void writeUint (const char8_t * key, std:: uint64_t value ) noexcept
72
83
{
73
84
if (shouldWriteMe ()) {
74
85
const auto previousWriteIndex = writeIndex;
75
- if (writeCommaAfterPreviousElement () && writeKey (key) && writeUint (valueGetter () ))
86
+ if (writeCommaAfterPreviousElement () && writeKey (key) && writeUint (value ))
76
87
increaseConversionIndexInNestingLevel ();
77
88
else
78
89
writeIndex = previousWriteIndex;
79
90
}
80
91
increaseIndexInNestingLevel ();
81
92
}
82
93
83
- private:
84
94
[[nodiscard]] bool writeKey (const char8_t * key) noexcept
85
95
{
86
96
return writeChar (u8' "' ) && writeString (key) && writeString (u8" \" :" );
@@ -125,7 +135,7 @@ class ConfigToString {
125
135
++indexInNestingLevel[nestingLevel];
126
136
}
127
137
128
- void increaseConversionIndexInNestingLevel ()const noexcept
138
+ void increaseConversionIndexInNestingLevel () const noexcept
129
139
{
130
140
assert (conversionState.indexInNestingLevel [conversionState.nestingLevel ] < config_params::kMaxObjectIndex );
131
141
++conversionState.indexInNestingLevel [conversionState.nestingLevel ];
0 commit comments