1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:47:35 +00:00

AK: Rename Stream::write_entire_buffer to Stream::write_until_depleted

No functional changes.
This commit is contained in:
Tim Schumacher 2023-03-01 15:37:45 +01:00 committed by Linus Groh
parent a3f73e7d85
commit ecd1862859
46 changed files with 141 additions and 141 deletions

View file

@ -177,7 +177,7 @@ ErrorOr<void> Image::export_bmp_to_file(NonnullOwnPtr<Stream> stream, bool prese
auto bitmap = TRY(compose_bitmap(bitmap_format));
auto encoded_data = TRY(Gfx::BMPWriter::encode(*bitmap));
TRY(stream->write_entire_buffer(encoded_data));
TRY(stream->write_until_depleted(encoded_data));
return {};
}
@ -187,7 +187,7 @@ ErrorOr<void> Image::export_png_to_file(NonnullOwnPtr<Stream> stream, bool prese
auto bitmap = TRY(compose_bitmap(bitmap_format));
auto encoded_data = TRY(Gfx::PNGWriter::encode(*bitmap));
TRY(stream->write_entire_buffer(encoded_data));
TRY(stream->write_until_depleted(encoded_data));
return {};
}
@ -196,7 +196,7 @@ ErrorOr<void> Image::export_qoi_to_file(NonnullOwnPtr<Stream> stream) const
auto bitmap = TRY(compose_bitmap(Gfx::BitmapFormat::BGRA8888));
auto encoded_data = TRY(Gfx::QOIWriter::encode(bitmap));
TRY(stream->write_entire_buffer(encoded_data));
TRY(stream->write_until_depleted(encoded_data));
return {};
}

View file

@ -793,7 +793,7 @@ ErrorOr<void> ImageEditor::save_project_to_file(NonnullOwnPtr<Core::File> file)
TRY(json_guides.finish());
TRY(json.finish());
TRY(file->write_entire_buffer(builder.string_view().bytes()));
TRY(file->write_until_depleted(builder.string_view().bytes()));
return {};
}

View file

@ -248,8 +248,8 @@ ErrorOr<Vector<Color>> PaletteWidget::load_palette_path(DeprecatedString const&
ErrorOr<void> PaletteWidget::save_palette_file(Vector<Color> palette, NonnullOwnPtr<Core::File> file)
{
for (auto& color : palette) {
TRY(file->write_entire_buffer(color.to_deprecated_string_without_alpha().bytes()));
TRY(file->write_entire_buffer({ "\n", 1 }));
TRY(file->write_until_depleted(color.to_deprecated_string_without_alpha().bytes()));
TRY(file->write_until_depleted({ "\n", 1 }));
}
return {};
}