C++ Utilities 5.26.1
Useful C++ classes and routines such as argument parser, IO and conversion utilities
|
The CopyHelper class helps to copy bytes from one stream to another. More...
#include <copy.h>
Public Member Functions | |
CopyHelper () | |
Constructs a new copy helper. | |
void | copy (std::istream &input, std::ostream &output, std::uint64_t count) |
Copies count bytes from input to output. | |
void | callbackCopy (std::istream &input, std::ostream &output, std::uint64_t count, const std::function< bool(void)> &isAborted, const std::function< void(double)> &callback) |
Copies count bytes from input to output. | |
void | copy (NativeFileStream &input, NativeFileStream &output, std::uint64_t count) |
Copies count bytes from input to output. | |
void | callbackCopy (NativeFileStream &input, NativeFileStream &output, std::uint64_t count, const std::function< bool(void)> &isAborted, const std::function< void(double)> &callback) |
Copies count bytes from input to output. | |
char * | buffer () |
Returns the internal buffer. | |
The CopyHelper class helps to copy bytes from one stream to another.
Specifies | the chunk/buffer size. |
CppUtilities::CopyHelper< bufferSize >::CopyHelper | ( | ) |
char * CppUtilities::CopyHelper< bufferSize >::buffer | ( | ) |
void CppUtilities::CopyHelper< bufferSize >::callbackCopy | ( | NativeFileStream & | input, |
NativeFileStream & | output, | ||
std::uint64_t | count, | ||
const std::function< bool(void)> & | isAborted, | ||
const std::function< void(double)> & | callback ) |
Copies count bytes from input to output.
The procedure might be aborted and progress updates will be reported.
Before processing the next chunk isAborted is checked and the copying aborted if it returns true. Before processing the next chunk callback is invoked to report the current progress.
void CppUtilities::CopyHelper< bufferSize >::callbackCopy | ( | std::istream & | input, |
std::ostream & | output, | ||
std::uint64_t | count, | ||
const std::function< bool(void)> & | isAborted, | ||
const std::function< void(double)> & | callback ) |
Copies count bytes from input to output.
The procedure might be aborted and progress updates will be reported.
Before processing the next chunk isAborted is checked and the copying aborted if it returns true. Before processing the next chunk callback is invoked to report the current progress.
void CppUtilities::CopyHelper< bufferSize >::copy | ( | NativeFileStream & | input, |
NativeFileStream & | output, | ||
std::uint64_t | count ) |
void CppUtilities::CopyHelper< bufferSize >::copy | ( | std::istream & | input, |
std::ostream & | output, | ||
std::uint64_t | count ) |