mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:37:34 +00:00
AK: Rename Stream::write_entire_buffer to Stream::write_until_depleted
No functional changes.
This commit is contained in:
parent
a3f73e7d85
commit
ecd1862859
46 changed files with 141 additions and 141 deletions
|
@ -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 {};
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {};
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {};
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ ErrorOr<void> ExportDialog::make_and_run_for(StringView mime, Core::File& file,
|
|||
array.append(sheet->to_json());
|
||||
|
||||
auto file_content = array.to_deprecated_string();
|
||||
return file.write_entire_buffer(file_content.bytes());
|
||||
return file.write_until_depleted(file_content.bytes());
|
||||
};
|
||||
|
||||
if (mime == "text/csv") {
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
auto with_headers = has_flag(writer.m_behaviors, WriterBehavior::WriteHeaders);
|
||||
if (with_headers) {
|
||||
TRY(writer.write_row(writer.m_names));
|
||||
TRY(writer.m_output.write_entire_buffer({ "\n", 1 }));
|
||||
TRY(writer.m_output.write_until_depleted({ "\n", 1 }));
|
||||
}
|
||||
|
||||
for (auto&& row : writer.m_data) {
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
}
|
||||
|
||||
TRY(writer.write_row(row));
|
||||
TRY(writer.m_output.write_entire_buffer({ "\n", 1 }));
|
||||
TRY(writer.m_output.write_until_depleted({ "\n", 1 }));
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
auto with_headers = has_flag(writer.m_behaviors, WriterBehavior::WriteHeaders);
|
||||
if (with_headers) {
|
||||
TRY(writer.write_row(writer.m_names));
|
||||
TRY(writer.m_output.write_entire_buffer({ "\n", 1 }));
|
||||
TRY(writer.m_output.write_until_depleted({ "\n", 1 }));
|
||||
++lines_written;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
}
|
||||
|
||||
TRY(writer.write_row(row));
|
||||
TRY(writer.m_output.write_entire_buffer({ "\n", 1 }));
|
||||
TRY(writer.m_output.write_until_depleted({ "\n", 1 }));
|
||||
++lines_written;
|
||||
|
||||
if (lines_written >= max_preview_lines)
|
||||
|
@ -110,7 +110,7 @@ private:
|
|||
bool first = true;
|
||||
for (auto&& entry : row) {
|
||||
if (!first) {
|
||||
TRY(m_output.write_entire_buffer(m_traits.separator.bytes()));
|
||||
TRY(m_output.write_until_depleted(m_traits.separator.bytes()));
|
||||
}
|
||||
first = false;
|
||||
TRY(write_entry(entry));
|
||||
|
@ -136,33 +136,33 @@ private:
|
|||
|
||||
if (safe_to_write_normally) {
|
||||
if (!string.is_empty())
|
||||
TRY(m_output.write_entire_buffer(string.bytes()));
|
||||
TRY(m_output.write_until_depleted(string.bytes()));
|
||||
return {};
|
||||
}
|
||||
|
||||
TRY(m_output.write_entire_buffer(m_traits.quote.bytes()));
|
||||
TRY(m_output.write_until_depleted(m_traits.quote.bytes()));
|
||||
|
||||
GenericLexer lexer(string);
|
||||
while (!lexer.is_eof()) {
|
||||
if (lexer.consume_specific(m_traits.quote)) {
|
||||
switch (m_traits.quote_escape) {
|
||||
case WriterTraits::Repeat:
|
||||
TRY(m_output.write_entire_buffer(m_traits.quote.bytes()));
|
||||
TRY(m_output.write_entire_buffer(m_traits.quote.bytes()));
|
||||
TRY(m_output.write_until_depleted(m_traits.quote.bytes()));
|
||||
TRY(m_output.write_until_depleted(m_traits.quote.bytes()));
|
||||
break;
|
||||
case WriterTraits::Backslash:
|
||||
TRY(m_output.write_entire_buffer({ "\\", 1 }));
|
||||
TRY(m_output.write_entire_buffer(m_traits.quote.bytes()));
|
||||
TRY(m_output.write_until_depleted({ "\\", 1 }));
|
||||
TRY(m_output.write_until_depleted(m_traits.quote.bytes()));
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
auto ch = lexer.consume();
|
||||
TRY(m_output.write_entire_buffer({ &ch, 1 }));
|
||||
TRY(m_output.write_until_depleted({ &ch, 1 }));
|
||||
}
|
||||
|
||||
TRY(m_output.write_entire_buffer(m_traits.quote.bytes()));
|
||||
TRY(m_output.write_until_depleted(m_traits.quote.bytes()));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue