mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
Add ZoneWriting basis
This commit is contained in:
46
src/ZoneWriting/Writing/Processor/OutputProcessorXChunks.cpp
Normal file
46
src/ZoneWriting/Writing/Processor/OutputProcessorXChunks.cpp
Normal 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;
|
||||
}
|
26
src/ZoneWriting/Writing/Processor/OutputProcessorXChunks.h
Normal file
26
src/ZoneWriting/Writing/Processor/OutputProcessorXChunks.h
Normal 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;
|
||||
};
|
@ -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;
|
||||
};
|
@ -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;
|
||||
};
|
@ -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;
|
||||
};
|
Reference in New Issue
Block a user