TarWriter¶
-
class TarWriter¶
Writes a POSIX ustar archive, readable by any standard tar tool.
Entries are regular files, added one at a time. Names longer than 100 characters are split over the ustar
prefixandnamefields; names that do not fit even then are rejected. The archive is finished by close or the destructor.Public Functions
-
explicit TarWriter(const std::string &file_name)¶
Create (or truncate) the archive at
file_name.
-
~TarWriter()¶
-
void add(const std::string &name, const char *data, std::size_t size)¶
Append a file called
namewith the given contents.
-
void close()¶
Write the end-of-archive marker and close the file.
-
explicit TarWriter(const std::string &file_name)¶