mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 18:37:35 +00:00
Spreadsheet: Move to a non-owning model for Stream
in Writer::XSV
This commit is contained in:
parent
fc413711ee
commit
4952cdfe2b
5 changed files with 75 additions and 59 deletions
|
@ -12,12 +12,18 @@
|
|||
|
||||
namespace Writer {
|
||||
|
||||
template<typename ContainerType>
|
||||
class CSV : public XSV<ContainerType> {
|
||||
class CSV {
|
||||
public:
|
||||
CSV(Core::Stream::Handle<Core::Stream::Stream> output, ContainerType const& data, Vector<StringView> headers = {}, WriterBehavior behaviors = default_behaviors())
|
||||
: XSV<ContainerType>(move(output), data, { ",", "\"", WriterTraits::Repeat }, move(headers), behaviors)
|
||||
template<typename ContainerType>
|
||||
static ErrorOr<void> generate(Core::Stream::Stream& output, ContainerType const& data, Vector<StringView> headers = {}, WriterBehavior behaviors = default_behaviors())
|
||||
{
|
||||
return XSV<ContainerType>::generate(output, data, { ",", "\"", WriterTraits::Repeat }, move(headers), behaviors);
|
||||
}
|
||||
|
||||
template<typename ContainerType>
|
||||
static ErrorOr<void> generate_preview(Core::Stream::Stream& output, ContainerType const& data, Vector<StringView> headers = {}, WriterBehavior behaviors = default_behaviors())
|
||||
{
|
||||
return XSV<ContainerType>::generate_preview(output, data, { ",", "\"", WriterTraits::Repeat }, move(headers), behaviors);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue