This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add a simple StringStream class.
ClosedPublic

Authored by sivachandra on Jul 22 2022, 12:14 AM.

Details

Summary

This class will be used in future changes to construct simple strings.

Diff Detail

Event Timeline

sivachandra created this revision.Jul 22 2022, 12:14 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 22 2022, 12:14 AM
sivachandra requested review of this revision.Jul 22 2022, 12:14 AM

Add more tests.

michaelrj added inline comments.Jul 22 2022, 3:45 PM
libc/src/__support/CPP/stringstream.h
16

it would probably be better to include StringView explicitly instead of through integer_to_string.

27

why is this separate from write_size? It seems like they're tracking the same data.

Address comments.

sivachandra marked an inline comment as done.Jul 25 2022, 12:38 AM
sivachandra added inline comments.
libc/src/__support/CPP/stringstream.h
27

Ah, I had a seek method which I removed as I don't need it anymore. Forgot to clean this up. Done now.

This revision is now accepted and ready to land.Jul 25 2022, 10:43 AM
This revision was automatically updated to reflect the committed changes.