Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
pzstd Namespace Reference

Namespaces

namespace  detail
 

Data Structures

class  Buffer
 
class  BufferWorkQueue
 Work queue for Buffers that knows the total number of bytes in the queue. More...
 
class  ErrorHolder
 
class  Logger
 
struct  Options
 
class  Range
 
class  ResourcePool
 
class  ScopeGuard
 
class  SharedState
 
class  SkippableFrame
 
class  ThreadPool
 A simple thread pool that pulls tasks off its queue in FIFO order. More...
 
class  WorkQueue
 Unbounded thread-safe work queue. More...
 

Typedefs

typedef struct ::stat file_status
 
using ByteRange = Range<const unsigned char*>
 
using MutableByteRange = Range<unsigned char*>
 
using StringPiece = Range<const char*>
 

Functions

int pzstdMain (const Options &options)
 
void advance (Buffer &buffer, ZSTD_inBuffer &inBuffer)
 
Buffer split (Buffer &buffer, ZSTD_outBuffer &outBuffer)
 
std::uint64_t asyncCompressChunks (SharedState &state, WorkQueue< std::shared_ptr< BufferWorkQueue > > &chunks, ThreadPool &executor, FILE *fd, std::uintmax_t size, size_t numThreads, ZSTD_parameters params)
 
std::uint64_t asyncDecompressFrames (SharedState &state, WorkQueue< std::shared_ptr< BufferWorkQueue > > &frames, ThreadPool &executor, FILE *fd)
 
std::uint64_t writeFile (SharedState &state, WorkQueue< std::shared_ptr< BufferWorkQueue > > &outs, FILE *outputFd, bool decompress)
 
std::uint64_t asyncCompressChunks (SharedState &state, WorkQueue< std::shared_ptr< BufferWorkQueue > > &chunks, ThreadPool &executor, FILE *fd, std::uintmax_t size, std::size_t numThreads, ZSTD_parameters parameters)
 
bool operator== (const Options &lhs, const Options &rhs)
 
std::ostream & operator<< (std::ostream &out, const Options &opt)
 
bool check (std::string source, std::string decompressed)
 
bool roundTrip (Options &options)
 
file_status status (StringPiece path, std::error_code &ec) noexcept
 http://en.cppreference.com/w/cpp/filesystem/status
 
bool is_regular_file (file_status status) noexcept
 http://en.cppreference.com/w/cpp/filesystem/is_regular_file
 
bool is_regular_file (StringPiece path, std::error_code &ec) noexcept
 http://en.cppreference.com/w/cpp/filesystem/is_regular_file
 
bool is_directory (file_status status) noexcept
 http://en.cppreference.com/w/cpp/filesystem/is_directory
 
bool is_directory (StringPiece path, std::error_code &ec) noexcept
 http://en.cppreference.com/w/cpp/filesystem/is_directory
 
std::uintmax_t file_size (StringPiece path, std::error_code &ec) noexcept
 http://en.cppreference.com/w/cpp/filesystem/file_size
 
template<typename Function >
ScopeGuard< Function > makeScopeGuard (Function &&function)
 Creates a scope guard from function.
 

Variables

constexpr int kLogError = 1
 
constexpr int kLogInfo = 2
 
constexpr int kLogDebug = 3
 
constexpr int kLogVerbose = 4
 

Detailed Description

A subset of folly/Range.h. All code copied verbatim modulo formatting

Typedef Documentation

◆ ByteRange

typedef Range< const unsigned char * > ByteRange = Range<const unsigned char*>

◆ file_status

typedef struct::stat file_status

◆ MutableByteRange

typedef Range< unsigned char * > MutableByteRange = Range<unsigned char*>

◆ StringPiece

typedef Range< const char * > StringPiece = Range<const char*>

Function Documentation

◆ advance()

void advance ( Buffer & buffer,
ZSTD_inBuffer & inBuffer )

Advance buffer and inBuffer by the amount of data read, as indicated by inBuffer.pos.

◆ asyncCompressChunks() [1/2]

std::uint64_t asyncCompressChunks ( SharedState & state,
WorkQueue< std::shared_ptr< BufferWorkQueue > > & chunks,
ThreadPool & executor,
FILE * fd,
std::uintmax_t size,
size_t numThreads,
ZSTD_parameters params )

◆ asyncCompressChunks() [2/2]

std::uint64_t asyncCompressChunks ( SharedState & state,
WorkQueue< std::shared_ptr< BufferWorkQueue > > & chunks,
ThreadPool & executor,
FILE * fd,
std::uintmax_t size,
std::size_t numThreads,
ZSTD_parameters parameters )

Streams input from fd, breaks input up into chunks, and compresses each chunk independently. Output of each chunk gets streamed to a queue, and the output queues get put into chunks in order.

Parameters
stateThe shared state
chunksEach compression jobs output queue gets pushed() here as soon as it is available
executorThe thread pool to run compression jobs in
fdThe input file descriptor
sizeThe size of the input file if known, 0 otherwise
numThreadsThe number of threads in the thread pool
parametersThe zstd parameters to use for compression
Returns
The number of bytes read from the file

◆ asyncDecompressFrames()

std::uint64_t asyncDecompressFrames ( SharedState & state,
WorkQueue< std::shared_ptr< BufferWorkQueue > > & frames,
ThreadPool & executor,
FILE * fd )

Streams input from fd. If pzstd headers are available it breaks the input up into independent frames. It sends each frame to an independent decompression job. Output of each frame gets streamed to a queue, and the output queues get put into frames in order.

Parameters
stateThe shared state
framesEach decompression jobs output queue gets pushed() here as soon as it is available
executorThe thread pool to run compression jobs in
fdThe input file descriptor
Returns
The number of bytes read from the file

◆ check()

bool check ( std::string source,
std::string decompressed )
inline

◆ file_size()

◆ is_directory() [1/2]

◆ is_directory() [2/2]

◆ is_regular_file() [1/2]

◆ is_regular_file() [2/2]

◆ makeScopeGuard()

template<typename Function >
ScopeGuard< Function > makeScopeGuard ( Function && function)

Creates a scope guard from function.

◆ operator<<()

std::ostream & operator<< ( std::ostream & out,
const Options & opt )

◆ operator==()

bool operator== ( const Options & lhs,
const Options & rhs )

◆ pzstdMain()

int pzstdMain ( const Options & options)

Runs pzstd with options and returns the number of bytes written. An error occurred if errorHandler.hasError().

Parameters
optionsThe pzstd options to use for (de)compression
Returns
0 upon success and non-zero on failure.

◆ roundTrip()

bool roundTrip ( Options & options)
inline

◆ split()

Buffer split ( Buffer & buffer,
ZSTD_outBuffer & outBuffer )

Split buffer and advance outBuffer by the amount of data written, as indicated by outBuffer.pos.

◆ status()

◆ writeFile()

std::uint64_t writeFile ( SharedState & state,
WorkQueue< std::shared_ptr< BufferWorkQueue > > & outs,
FILE * outputFd,
bool decompress )

Streams input in from each queue in outs in order, and writes the data to outputFd.

Parameters
stateThe shared state
outsA queue of output queues, one for each (de)compression job.
outputFdThe file descriptor to write to
decompressAre we decompressing?
Returns
The number of bytes written

Variable Documentation

◆ kLogDebug

int kLogDebug = 3
constexpr

◆ kLogError

int kLogError = 1
constexpr

◆ kLogInfo

int kLogInfo = 2
constexpr

◆ kLogVerbose

int kLogVerbose = 4
constexpr