summaryrefslogtreecommitdiffstats
path: root/Source/cmArchiveWrite.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-04-04 18:03:21 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2020-03-31 15:08:32 (GMT)
commitb9c17de023ea50e7be358519141971aa136858ca (patch)
tree348ecb16aa8ac6193f0a837b3255d4c933b77c68 /Source/cmArchiveWrite.cxx
parent206a65c3b8156acc0677a9adb2ab149021f25c20 (diff)
downloadCMake-b9c17de023ea50e7be358519141971aa136858ca.zip
CMake-b9c17de023ea50e7be358519141971aa136858ca.tar.gz
CMake-b9c17de023ea50e7be358519141971aa136858ca.tar.bz2
cmArchiveWrite: split out opening the file
This allows options to be set before the "header" phase of libarchive's API.
Diffstat (limited to 'Source/cmArchiveWrite.cxx')
-rw-r--r--Source/cmArchiveWrite.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index d29b2ac..07136da 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -170,15 +170,19 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c,
cm_archive_error_string(this->Archive));
return;
}
+}
+bool cmArchiveWrite::Open()
+{
if (archive_write_open(
this->Archive, this, nullptr,
reinterpret_cast<archive_write_callback*>(&Callback::Write),
nullptr) != ARCHIVE_OK) {
this->Error =
cmStrCat("archive_write_open: ", cm_archive_error_string(this->Archive));
- return;
+ return false;
}
+ return true;
}
cmArchiveWrite::~cmArchiveWrite()