diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2020-04-20 21:51:58 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2020-04-20 21:52:07 +0200 |
| commit | 4ded6e352ee0fb5d96d2e1b9f051aac1f07b4886 (patch) | |
| tree | 8d29721809a690acbbaa2efb56402f55eb6436c1 /src/cppc4group.hpp | |
| parent | d42414b65cdb0156a5a2064a08c894c19370d7a7 (diff) | |
| download | cc4group-4ded6e352ee0fb5d96d2e1b9f051aac1f07b4886.tar.gz cc4group-4ded6e352ee0fb5d96d2e1b9f051aac1f07b4886.zip | |
Rework group saving
save / saveParent write back to the original group
saveParent saves changes in child groups (openAsChild) by saving the top-most parent
saveAs / saveAsOverwrite resembles the old save / saveOverwrite
For all other saving methods, groups opend with openAsChild are saved as if there was no parent
Diffstat (limited to 'src/cppc4group.hpp')
| -rw-r--r-- | src/cppc4group.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cppc4group.hpp b/src/cppc4group.hpp index 0ca9eb1..33cf2cc 100644 --- a/src/cppc4group.hpp +++ b/src/cppc4group.hpp @@ -153,8 +153,10 @@ public: bool openMemory(const void* const data, const size_t size, const MemoryManagement& management = MemoryManagement::Reference); bool openWithReadCallback(const ReadCallback callback, void* const callbackArg, const MemoryManagement& management = MemoryManagement::Take, SetupCallback initCallback = nullptr, SetupCallback deinitCallback = nullptr); - // 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); + // save actually maps to both cc4group.save and cc4group.saveParent, thanks to default arguments (yes, thats the reason why they are separate in the C-API) + bool save(const bool parent = false); + // saveAs actually maps to both cc4group.saveAs and cc4group.saveAsOverwrite, as above + bool saveAs(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); |
