Use std::string_view and fmtlib across all libraries (#3402)

- Twine, StringRef, Format, and NativeFormatting have been removed
- Logging now uses fmtlib style formatting
- Nearly all uses of wpi::outs/errs have been replaced with fmt::print() or
std::puts()/std::fputs() (for unformatted strings).
- A wpi/fmt/raw_ostream.h header has been added to enable
fmt::print() with wpi::raw_ostream
This commit is contained in:
Peter Johnson
2021-06-06 16:13:58 -07:00
committed by GitHub
parent 4f1cecb8e7
commit b2c3b2dd8e
441 changed files with 5061 additions and 9749 deletions

View File

@@ -216,7 +216,7 @@ SHA1::SHA1() {
reset(digest, buf_size, transforms);
}
void SHA1::Update(StringRef s) {
void SHA1::Update(std::string_view s) {
raw_mem_istream is(makeArrayRef(s.data(), s.size()));
Update(is);
}
@@ -293,7 +293,7 @@ std::string SHA1::Final() {
return os.str();
}
StringRef SHA1::Final(SmallVectorImpl<char>& buf) {
std::string_view SHA1::Final(SmallVectorImpl<char>& buf) {
raw_svector_ostream os(buf);
finalize(digest, buffer, buf_size, transforms, os, true);
@@ -301,7 +301,7 @@ StringRef SHA1::Final(SmallVectorImpl<char>& buf) {
return os.str();
}
StringRef SHA1::RawFinal(SmallVectorImpl<char>& buf) {
std::string_view SHA1::RawFinal(SmallVectorImpl<char>& buf) {
raw_svector_ostream os(buf);
finalize(digest, buffer, buf_size, transforms, os, false);
@@ -309,7 +309,7 @@ StringRef SHA1::RawFinal(SmallVectorImpl<char>& buf) {
return os.str();
}
std::string SHA1::FromFile(StringRef filename) {
std::string SHA1::FromFile(std::string_view filename) {
std::error_code ec;
raw_fd_istream stream(filename, ec);
SHA1 checksum;