Add ZoneWriting basis

This commit is contained in:
Jan
2021-03-15 22:36:07 +01:00
parent 301f6e3e7a
commit 9d26c9c927
66 changed files with 1344 additions and 111 deletions

View File

@ -0,0 +1,46 @@
#include "OutputProcessorXChunks.h"
class OutputProcessorXChunks::Impl
{
};
OutputProcessorXChunks::OutputProcessorXChunks(int numStreams, size_t xChunkSize)
{
}
OutputProcessorXChunks::OutputProcessorXChunks(int numStreams, size_t xChunkSize, size_t vanillaBufferSize)
{
}
OutputProcessorXChunks::~OutputProcessorXChunks()
{
delete m_impl;
m_impl = nullptr;
}
OutputProcessorXChunks::OutputProcessorXChunks(OutputProcessorXChunks&& other) noexcept
: m_impl(other.m_impl)
{
other.m_impl = nullptr;
}
OutputProcessorXChunks& OutputProcessorXChunks::operator=(OutputProcessorXChunks&& other) noexcept
{
m_impl = other.m_impl;
other.m_impl = nullptr;
return *this;
}
void OutputProcessorXChunks::AddChunkProcessor(std::unique_ptr<IXChunkOutputProcessor> chunkProcessor) const
{
}
void OutputProcessorXChunks::Write(const void* buffer, size_t length)
{
}
int64_t OutputProcessorXChunks::Pos()
{
return 0;
}

View File

@ -0,0 +1,26 @@
#pragma once
#include <memory>
#include "Writing/OutputStreamProcessor.h"
#include "XChunks/IXChunkOutputProcessor.h"
class OutputProcessorXChunks final : public OutputStreamProcessor
{
class Impl;
Impl* m_impl;
public:
OutputProcessorXChunks(int numStreams, size_t xChunkSize);
OutputProcessorXChunks(int numStreams, size_t xChunkSize, size_t vanillaBufferSize);
~OutputProcessorXChunks() override;
OutputProcessorXChunks(const OutputProcessorXChunks& other) = delete;
OutputProcessorXChunks(OutputProcessorXChunks&& other) noexcept;
OutputProcessorXChunks& operator=(const OutputProcessorXChunks& other) = delete;
OutputProcessorXChunks& operator=(OutputProcessorXChunks&& other) noexcept;
void AddChunkProcessor(std::unique_ptr<IXChunkOutputProcessor> chunkProcessor) const;
void Write(const void* buffer, size_t length) override;
int64_t Pos() override;
};

View File

@ -0,0 +1,17 @@
#pragma once
#include <cstdint>
#include <cstddef>
class IXChunkOutputProcessor
{
public:
IXChunkOutputProcessor() = default;
virtual ~IXChunkOutputProcessor() = default;
IXChunkOutputProcessor(const IXChunkOutputProcessor& other) = default;
IXChunkOutputProcessor(IXChunkOutputProcessor&& other) noexcept = default;
IXChunkOutputProcessor& operator=(const IXChunkOutputProcessor& other) = default;
IXChunkOutputProcessor& operator=(IXChunkOutputProcessor&& other) noexcept = default;
virtual size_t Process(int streamNumber, const uint8_t* input, size_t inputLength, uint8_t* output, size_t outputBufferSize) = 0;
};

View File

@ -0,0 +1,8 @@
#pragma once
#include "IXChunkOutputProcessor.h"
class XChunkOutputProcessorDeflate final : public IXChunkOutputProcessor
{
public:
size_t Process(int streamNumber, const uint8_t* input, size_t inputLength, uint8_t* output, size_t outputBufferSize) override;
};

View File

@ -0,0 +1,20 @@
#pragma once
#include "IXChunkOutputProcessor.h"
#include "Utils/ICapturedDataProvider.h"
class XChunkOutputProcessorSalsa20 final : public IXChunkOutputProcessor, public ICapturedDataProvider
{
class Impl;
Impl* m_impl;
public:
XChunkOutputProcessorSalsa20(int streamCount, std::string& zoneName, const uint8_t* salsa20Key, size_t keySize);
~XChunkOutputProcessorSalsa20() override;
XChunkOutputProcessorSalsa20(const XChunkOutputProcessorSalsa20& other) = delete;
XChunkOutputProcessorSalsa20(XChunkOutputProcessorSalsa20&& other) noexcept = default;
XChunkOutputProcessorSalsa20& operator=(const XChunkOutputProcessorSalsa20& other) = delete;
XChunkOutputProcessorSalsa20& operator=(XChunkOutputProcessorSalsa20&& other) noexcept = default;
size_t Process(int streamNumber, const uint8_t* input, size_t inputLength, uint8_t* output, size_t outputBufferSize) override;
void GetCapturedData(const uint8_t** pCapturedData, size_t* pSize) override;
};