From 9103fb5b961817d1a91248632b4cedfec770b198 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Sat, 16 Mar 2019 03:50:28 +0100 Subject: Add openFd, openFilePointer and openWithReadCallback methods --- src/cppc4group.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/cppc4group.hpp') diff --git a/src/cppc4group.hpp b/src/cppc4group.hpp index 67d350d..0787c97 100644 --- a/src/cppc4group.hpp +++ b/src/cppc4group.hpp @@ -3,6 +3,7 @@ #include #include #include +#include class CppC4Group { struct Private; @@ -30,6 +31,8 @@ public: }; public: + using ReadCallback = bool(*)(const void** const data, size_t* const size, void* const arg); + enum TmpMemoryStrategy { Memory, File, @@ -50,6 +53,10 @@ public: void create(); bool openExisting(const std::string& path); + bool openFd(const int fd); + bool openFilePointer(FILE* file); + bool openMemory(const void* const data, const size_t size, const MemoryManagement management = Reference); + bool openWithReadCallback(const ReadCallback callback, void* const callbackArg, const MemoryManagement management = Take); bool save(const std::string& path, const bool overwrite = false); bool extractAll(const std::string& path); -- cgit v1.2.3-54-g00ecf