Simplify StringBuilder API/align with makeString by removing appendFixed* functions and using FormatNumber struct instead
https://bugs.webkit.org/show_bug.cgi?id=205671
Reviewed by Alex Christensen.
Source/JavaScriptCore:
- API/tests/ExecutionTimeLimitTest.cpp:
(testExecutionTimeLimit):
(JSC::OptionReader::Option::dump const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).
Source/WebCore:
- css/CSSFontVariationValue.cpp:
- css/CSSKeyframeRule.cpp:
- css/CSSTimingFunctionValue.cpp:
- css/parser/CSSParserToken.cpp:
- html/HTMLImageElement.cpp:
- page/scrolling/AxisScrollSnapOffsets.cpp:
- platform/graphics/Color.cpp:
- platform/graphics/ExtendedColor.cpp:
- platform/graphics/ca/win/PlatformCALayerWin.cpp:
- platform/graphics/freetype/FontCacheFreeType.cpp:
- svg/SVGNumberList.h:
- svg/SVGPathStringBuilder.cpp:
- svg/SVGPointList.h:
- svg/SVGTransformValue.h:
- svg/properties/SVGPropertyTraits.h:
- testing/Internals.cpp:
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...))
and builder.appendFixedWidthNumber(...) with with builder.append(FormattedNumber::fixedWidth(...))
Source/WebKit:
- NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::dumpContentsToFile):
- NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::asJSON const):
- Shared/Gamepad/GamepadData.cpp:
(WebKit::GamepadData::loggingString const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).
Source/WTF:
In an ongoing attempt to simplify the StringBuilder interface and unify it's functionality with makeString,
this change removes appendFixedPrecisionNumber() and appendFixedWidthNumber(), replacing their uses
with direct calls to append(), using a FormattedNumber object to direct it to the appropriate StringTypeAdapter.
- wtf/text/StringBuilder.h:
- wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendFixedPrecisionNumber): Deleted.
(WTF::StringBuilder::appendFixedWidthNumber): Deleted.
Remove StringBuilder::appendFixedPrecisionNumber() and StringBuilder::appendFixedWidthNumber(). The same functionality
is available and more flexible by passing FormattedNumbers to the variadic append() function.
(WTF::TextStream::operator<<):
(WTF::MediaTime::toString const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...))
and builder.appendFixedWidthNumber(...) with with builder.append(FormattedNumber::fixedWidth(...))
Tools:
- WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).