mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:27:45 +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
|
@ -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