summaryrefslogtreecommitdiffstats
path: root/src/cppc4group.hpp
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2019-04-17 01:32:08 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2019-04-17 01:32:08 +0200
commit19b23eafe4d8039e30bc4f49a4c04ebea9e85cda (patch)
treeb49ec9a9e604c055200745825b477b3821bd1549 /src/cppc4group.hpp
parentd2b440e8ed4de65bbba8e3a718552cb53c094913 (diff)
downloadcc4group-19b23eafe4d8039e30bc4f49a4c04ebea9e85cda.tar.gz
cc4group-19b23eafe4d8039e30bc4f49a4c04ebea9e85cda.zip
Add saveToFd, saveToFilePointer and saveWithWriteCallback
Diffstat (limited to 'src/cppc4group.hpp')
-rw-r--r--src/cppc4group.hpp6
1 files changed, 5 insertions, 1 deletions
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<TmpMemory>(*)(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);