summaryrefslogtreecommitdiffstats
path: root/src/cppc4group.cpp
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2020-04-20 21:51:58 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2020-04-20 21:52:07 +0200
commit4ded6e352ee0fb5d96d2e1b9f051aac1f07b4886 (patch)
tree8d29721809a690acbbaa2efb56402f55eb6436c1 /src/cppc4group.cpp
parentd42414b65cdb0156a5a2064a08c894c19370d7a7 (diff)
downloadcc4group-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.cpp')
-rw-r--r--src/cppc4group.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cppc4group.cpp b/src/cppc4group.cpp
index ea24f3b..4db6153 100644
--- a/src/cppc4group.cpp
+++ b/src/cppc4group.cpp
@@ -239,9 +239,14 @@ bool CppC4Group::openWithReadCallback(const ReadCallback callback, void* const c
return cc4group.openWithReadCallback(p->g, callback, callbackArg, convertMemoryManagement(management), initCallback, deinitCallback);
}
-bool CppC4Group::save(const std::string& path, const bool overwrite)
+bool CppC4Group::save(const bool parent)
{
- return (overwrite ? cc4group.saveOverwrite : cc4group.save)(p->g, path.c_str());
+ return (parent ? cc4group.saveParent : cc4group.save)(p->g);
+}
+
+bool CppC4Group::saveAs(const std::string& path, const bool overwrite)
+{
+ return (overwrite ? cc4group.saveAsOverwrite : cc4group.saveAs)(p->g, path.c_str());
}
bool CppC4Group::saveToFd(const int fd)