common saver: change to instance based for future sync/async behavior.

reserve sync() method TODO
This commit is contained in:
Hermet Park 2021-07-19 20:32:31 +09:00
parent b13dec31cd
commit 60e3129ce2
3 changed files with 17 additions and 2 deletions

View file

@ -1402,9 +1402,11 @@ public:
* @retval Result::MemoryCorruption When casting in the internal function implementation failed.
* @retval Result::Unknown Others.
*
* @BETA_API
*/
static Result save(std::unique_ptr<Paint> paint, const std::string& path) noexcept;
Result save(std::unique_ptr<Paint> paint, const std::string& path) noexcept;
Result sync() noexcept;
static std::unique_ptr<Saver> gen() noexcept;
_TVG_DECLARE_PRIVATE(Saver);
};

Binary file not shown.

View file

@ -59,3 +59,16 @@ Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path) noexce
delete p;
return Result::Unknown;
}
Result Saver::sync() noexcept
{
//TODO:
return Result::Success;
}
unique_ptr<Saver> Saver::gen() noexcept
{
return unique_ptr<Saver>(new Saver);
}