message: allow extracting message parts to file

And add unit-test.

Fixes #2467
This commit is contained in:
Dirk-Jan C. Binnema
2023-04-05 00:05:10 +03:00
parent cd23e6015d
commit 026a19bcfa
5 changed files with 41 additions and 20 deletions

View File

@ -829,6 +829,16 @@ public:
*/
Option<std::string> to_string_opt() const noexcept;
/**
* Write object to a file
*
* @param path path to file
* @param overwrite if true, overwrite existing file, if it bqexists
*
* @return size of the wrtten file, or an error.
*/
Result<size_t> to_file(const std::string& path, bool overwrite) const noexcept;
/*
* subtypes.
*/
@ -1101,7 +1111,6 @@ public:
*/
Option<std::string> to_string() const noexcept;
/**
* Write part to a file
*
@ -1113,7 +1122,6 @@ public:
Result<size_t> to_file(const std::string& path, bool overwrite)
const noexcept;
/**
* Types of Content Encoding.
*