Bug 199452
Summary: | WebKit has too many ways to stringify things | ||
---|---|---|---|
Product: | WebKit | Reporter: | Darin Adler <darin> |
Component: | Web Template Framework | Assignee: | Darin Adler <darin> |
Status: | ASSIGNED | ||
Severity: | Normal | CC: | fpizlo, mitz, mrobinson, sam, simon.fraser |
Priority: | P2 | ||
Version: | WebKit Local Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 199782 | ||
Bug Blocks: |
Darin Adler
WebKit has too many different ways to stringify things. Here are the ones I have found so far:
std::ostream
WTF::makeString (part of WTF’s StringConcatenate)
WTF::ValueToString
WTF::LogArgument (part of WTF::Logger)
WTF::PrintStream dump functions
WTF::TextStream
I plan to remove WTF::ValueToString first, changing the only client (POD trees) to use TextStream instead. I would welcome other ideas for how to get rid of this redundancy.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Darin Adler
WTF::StringBuilder
Darin Adler
Seems like we should remove PrintStream and replace it with TextStream. One way to do it is to make PrintStream use TextStream and then remove it a bit at a time.
Darin Adler
TextStream has some anomalies in how it serializes floating point numbers, always using fixed position with two decimal places.
Darin Adler
We’ve made progress on unifying makeString and StringBuilder, by having StringBuilder::append be built on the same underpinnings as makeString!
Darin Adler
In bug 199782 I deleted ValueToString. One down!
Simon Fraser (smfr)
(In reply to Darin Adler from comment #3)
> TextStream has some anomalies in how it serializes floating point numbers,
> always using fixed position with two decimal places.
We can control that with FormattingFlags (which itself should be an OptionSet<>).
Darin Adler
Yes. I was focusing on the default behavior, not the customizability of it