This patch adds the %f/F/e/E/g/G/a/A conversions for scanf, as well as
accompanying tests. This implementation matches the definition set forth
in the standard, which may conflict with some other implementations.
Details
- Reviewers
sivachandra lntue - Commits
- rG9a32e53941cc: [libc] add scanf float converter
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
split VectorString class into a separate patch (and file)
libc/src/stdio/scanf_core/float_converter.cpp | ||
---|---|---|
26 | I've separated adding the string class into a separate patch, but I'll talk more about my thought process here: I've kept the name VectorString for a couple reasons, the first being to make it clear that this can allocate. Next, due to it allocating it needs a way to report an error state in case allocation fails. The std::string class throws an exception when this happens, but we're not using exceptions so it has to be communicated in a different way. The way I have it currently is that when the append function is called to returns a boolean that represents if it has succeeded (as opposed to returning *this to allow for chained calls). This is a small but meaningful difference in API that I think is necessary but might confuse users if we used the existing name. |
Isn't this an equivalent of std::string? If yes, may be you should move it to CPP and name it cpp::string.