|
Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
|
#include <archive.hpp>
Classes | |
| class | AlreadyClosedException |
| class | CloseException |
| class | Exception |
| class | FileDoesNotExistException |
| class | FileExistsException |
| class | FileIOException |
| class | FileOpenException |
| class | InitException |
| class | NotRegularFileException |
Public Member Functions | |
| Archive (fs::path path, unsigned int buf_size=1024) | |
| Archive (std::unique_ptr< Connection > &conn, bool padding=true, unsigned int buf_size=1024) | |
| void | add_file (std::string filename, fs::path path) |
| void | add_file_stream (std::string filename, std::istream &stream, unsigned int size) |
| void | close () |
| ~Archive () | |
A class describing an archive file to be written to.
| adaptyst::Archive::Archive | ( | fs::path | path, |
| unsigned int | buf_size = 1024 ) |
Constructs an Archive object and opens a file for writing.
When the object is destructed, the file is guaranteed to be properly closed, but without any promises about whether all remaining data have been written. Therefore, you should explicitly call close() (which may throw an exception) before the object goes out of scope.
| path | The path to an archive file to be created. The file must not exist yet. |
| buf_size | A number of bytes of the internal buffers. |
| adaptyst::Archive::Archive | ( | std::unique_ptr< Connection > & | conn, |
| bool | padding = true, | ||
| unsigned int | buf_size = 1024 ) |
Constructs an Archive object with all archive file data to be sent through a Connection object.
When the object is destructed, the connection is guaranteed to be properly closed and all remaining data are guaranteed to have been written. Therefore, you DO NOT need to call close() before the object goes out of scope or anywhere else.
| conn | A Connection object which all archive file data will be sent through. |
| padding | Whether padding is allowed to be added to the last block of the archive file data if necessary. If you are not sure, this should be set to true (default). |
| buf_size | A number of bytes of the internal buffers. |
| adaptyst::Archive::~Archive | ( | ) |
| void adaptyst::Archive::add_file | ( | std::string | filename, |
| fs::path | path ) |
Adds a file to the root of the archive file.
| filename | The name of a file that will appear inside the archive. |
| path | The path to a file to be added to the archive. The file must be a regular file and not a directory. |
| void adaptyst::Archive::add_file_stream | ( | std::string | filename, |
| std::istream & | stream, | ||
| unsigned int | size ) |
Saves data extracted from a stream to the root of the archive file as a regular file.
| filename | The name of a file that will appear inside the archive. |
| stream | A stream containing data to be saved to the archive. |
| size | A number of bytes to save to the archive. If it's larger than the actual file size, the entire file will be added, followed by padding with zeroes. |
| void adaptyst::Archive::close | ( | ) |
Closes the file/connection and makes sure that all remaining data have been written.