The scanf implementation needs a dynamically resizing string class. This
patch adds a minimal version of that class along with tests to check the
current functionality.
Details
Details
- Reviewers
sivachandra - Commits
- rG176c853d1da5: [libc] add internal string class
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/__support/CPP/vector_string.h | ||
---|---|---|
24 ↗ | (On Diff #486995) | Shouldn't this be named string? |
libc/src/__support/CPP/vector_string.h | ||
---|---|---|
24 ↗ | (On Diff #486995) | I talked about it in my comment on the patch this was split out of but basically it has some differences from std::string that might warrant a different name. |
libc/src/__support/CPP/vector_string.h | ||
---|---|---|
24 ↗ | (On Diff #486995) | Ah, sorry! I did not look at that patch yet. Going by your explanation, what you have done previously is correct - Keep is scanf specific as we cannot add non-standard API in the CPP directory. Instead of VectorString, may be call it CharVector. |
libc/src/__support/CPP/vector_string.h | ||
---|---|---|
24 ↗ | (On Diff #486995) | If we do want it to be CharVector it might be better as a general utility in the __support directory since I could see other functions using it. Additionally that makes the unit testing easier. |
libc/src/__support/CPP/vector_string.h | ||
---|---|---|
24 ↗ | (On Diff #486995) | SGTM |