From 70e00f817e9596a746800ba4afec2b7c4ca25142 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sat, 4 Sep 2021 17:58:56 -0700 Subject: Migrate Template and TableTemplate to use DataStream --- core/src/Model/Template/TableTemplate.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'core/src/Model/Template/TableTemplate.hpp') diff --git a/core/src/Model/Template/TableTemplate.hpp b/core/src/Model/Template/TableTemplate.hpp index c651ce1..c6617b0 100644 --- a/core/src/Model/Template/TableTemplate.hpp +++ b/core/src/Model/Template/TableTemplate.hpp @@ -53,6 +53,9 @@ public: bool IsPrimaryCell() const; /// Return whether this cell is a part of a merged range or not. Includes the primary cell. bool IsMergedCell() const; + + template + void OperateIOProxy(TProxy& proxy); }; // TODO support reverse (bottom to top) filling order @@ -105,6 +108,9 @@ public: /// Find the location of the cell within this array group that has the given name. Vec2i FindCell(std::string_view name); bool UpdateCellName(std::string_view oldName, std::string_view newName); + + template + void OperateIOProxy(TProxy& proxy); }; // Forward declaration of libxlsxwriter structs @@ -211,6 +217,10 @@ public: lxw_workbook* InstantiateToExcelWorkbook(const TableInstantiationParameters& params) const; lxw_worksheet* InstantiateToExcelWorksheet(lxw_workbook* workbook, const TableInstantiationParameters& params) const; - ReadResult ReadFrom(std::istream& stream) override; - void WriteTo(std::ostream& stream) const override; + void ReadFromDataStream(InputDataStream& stream) override; + void WriteToDataStream(OutputDataStream& stream) override; + +private: + template + void OperateIOProxy(TProxy& proxy); }; -- cgit v1.2.3-70-g09d2