From 19b23eafe4d8039e30bc4f49a4c04ebea9e85cda Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Wed, 17 Apr 2019 01:32:08 +0200 Subject: Add saveToFd, saveToFilePointer and saveWithWriteCallback --- src/cppc4group.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cppc4group.hpp') diff --git a/src/cppc4group.hpp b/src/cppc4group.hpp index eb06585..03cb868 100644 --- a/src/cppc4group.hpp +++ b/src/cppc4group.hpp @@ -76,9 +76,10 @@ public: // or an empty optional on failure using TmpMemoryCallback = std::optional(*)(size_t size); - // these two are equivalent to their C counterparts + // these are equivalent to their C counterparts using ReadCallback = bool(*)(const void** const data, size_t* const size, void* const arg); using SetupCallback = bool(*)(void* const arg); + using WriteCallback = bool(*)(const void* const data, size_t const size, void* const arg); // these enums are just mapped to their C-counterparts internally enum TmpMemoryStrategy { @@ -119,6 +120,9 @@ public: // save actually maps to both cc4group.save and cc4group.saveOverwrite, thanks to default arguments (yes, thats the reason why they are separate in the C-API) bool save(const std::string& path, const bool overwrite = false); + bool saveToFd(const int fd); + bool saveToFilePointer(FILE* file); + bool saveWithWriteCallback(const WriteCallback callback, void* const arg = nullptr, size_t bufferSize = 0); bool extractAll(const std::string& path); bool extractSingle(const std::string& entryPath, const std::string& targetPath); -- cgit v1.2.3-54-g00ecf