From 7e9bfd8215440ffaf5bd6e2c5d446ae3789ed55c Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sat, 23 Sep 2023 16:40:13 +0100 Subject: [PATCH] [*] Move/refactor AuIO adapters to Aurora::IO::Adapters --- Include/Aurora/IO/{ => Adapters}/IOAdapterAsyncStream.hpp | 2 +- Include/Aurora/IO/{ => Adapters}/IOAdapterByteBuffer.hpp | 2 +- Include/Aurora/IO/{ => Adapters}/IOAdapterCompression.hpp | 2 +- Include/Aurora/IO/{ => Adapters}/IOAdapterSeeking.hpp | 2 +- Include/Aurora/IO/IOExperimental.hpp | 8 ++++---- Source/IO/{ => Adapters}/AuIOAdapterAsyncStream.cpp | 4 ++-- Source/IO/{ => Adapters}/AuIOAdapterAsyncStream.hpp | 2 +- Source/IO/{ => Adapters}/AuIOAdapterByteBuffer.cpp | 2 +- Source/IO/{ => Adapters}/AuIOAdapterByteBuffer.hpp | 2 +- Source/IO/{ => Adapters}/AuIOAdapterCompression.cpp | 2 +- Source/IO/{ => Adapters}/AuIOAdapterCompression.hpp | 2 +- Source/IO/{ => Adapters}/AuIOAdapterSeeking.cpp | 2 +- Source/IO/{ => Adapters}/AuIOAdapterSeeking.hpp | 2 +- Source/IO/AuIOPipeProcessor.cpp | 2 +- Source/IO/AuIOPipeProcessor.hpp | 4 ++-- Source/IO/Buffered/BlobBuilder.cpp | 7 ------- Source/IO/Buffered/BlobBuilder.hpp | 6 ------ 17 files changed, 20 insertions(+), 33 deletions(-) rename Include/Aurora/IO/{ => Adapters}/IOAdapterAsyncStream.hpp (97%) rename Include/Aurora/IO/{ => Adapters}/IOAdapterByteBuffer.hpp (93%) rename Include/Aurora/IO/{ => Adapters}/IOAdapterCompression.hpp (93%) rename Include/Aurora/IO/{ => Adapters}/IOAdapterSeeking.hpp (89%) rename Source/IO/{ => Adapters}/AuIOAdapterAsyncStream.cpp (99%) rename Source/IO/{ => Adapters}/AuIOAdapterAsyncStream.hpp (84%) rename Source/IO/{ => Adapters}/AuIOAdapterByteBuffer.cpp (97%) rename Source/IO/{ => Adapters}/AuIOAdapterByteBuffer.hpp (84%) rename Source/IO/{ => Adapters}/AuIOAdapterCompression.cpp (99%) rename Source/IO/{ => Adapters}/AuIOAdapterCompression.hpp (97%) rename Source/IO/{ => Adapters}/AuIOAdapterSeeking.cpp (97%) rename Source/IO/{ => Adapters}/AuIOAdapterSeeking.hpp (94%) delete mode 100644 Source/IO/Buffered/BlobBuilder.cpp delete mode 100644 Source/IO/Buffered/BlobBuilder.hpp diff --git a/Include/Aurora/IO/IOAdapterAsyncStream.hpp b/Include/Aurora/IO/Adapters/IOAdapterAsyncStream.hpp similarity index 97% rename from Include/Aurora/IO/IOAdapterAsyncStream.hpp rename to Include/Aurora/IO/Adapters/IOAdapterAsyncStream.hpp index bcd53680..17f5644b 100644 --- a/Include/Aurora/IO/IOAdapterAsyncStream.hpp +++ b/Include/Aurora/IO/Adapters/IOAdapterAsyncStream.hpp @@ -7,7 +7,7 @@ ***/ #pragma once -namespace Aurora::IO +namespace Aurora::IO::Adapters { struct IAsyncStreamReader : IStreamReader { diff --git a/Include/Aurora/IO/IOAdapterByteBuffer.hpp b/Include/Aurora/IO/Adapters/IOAdapterByteBuffer.hpp similarity index 93% rename from Include/Aurora/IO/IOAdapterByteBuffer.hpp rename to Include/Aurora/IO/Adapters/IOAdapterByteBuffer.hpp index 6224dbae..a328dfd8 100644 --- a/Include/Aurora/IO/IOAdapterByteBuffer.hpp +++ b/Include/Aurora/IO/Adapters/IOAdapterByteBuffer.hpp @@ -7,7 +7,7 @@ ***/ #pragma once -namespace Aurora::IO +namespace Aurora::IO::Adapters { AUKN_SYM AuSPtr NewByteBufferReadAdapter(const AuSPtr &pBuffer); AUKN_SYM AuSPtr NewByteBufferLinearSeekableAdapter(const AuSPtr &pBuffer); diff --git a/Include/Aurora/IO/IOAdapterCompression.hpp b/Include/Aurora/IO/Adapters/IOAdapterCompression.hpp similarity index 93% rename from Include/Aurora/IO/IOAdapterCompression.hpp rename to Include/Aurora/IO/Adapters/IOAdapterCompression.hpp index fd89a3ce..2f9aa492 100644 --- a/Include/Aurora/IO/IOAdapterCompression.hpp +++ b/Include/Aurora/IO/Adapters/IOAdapterCompression.hpp @@ -7,7 +7,7 @@ ***/ #pragma once -namespace Aurora::IO +namespace Aurora::IO::Adapters { AUKN_SYM AuSPtr NewCompressionReadAdapter(const AuSPtr &pCompresionStream); AUKN_SYM AuSPtr NewCompressionSeekingAdapter(const AuSPtr &pCompresionStream); diff --git a/Include/Aurora/IO/IOAdapterSeeking.hpp b/Include/Aurora/IO/Adapters/IOAdapterSeeking.hpp similarity index 89% rename from Include/Aurora/IO/IOAdapterSeeking.hpp rename to Include/Aurora/IO/Adapters/IOAdapterSeeking.hpp index 1ea88aea..1b680fc8 100644 --- a/Include/Aurora/IO/IOAdapterSeeking.hpp +++ b/Include/Aurora/IO/Adapters/IOAdapterSeeking.hpp @@ -7,7 +7,7 @@ ***/ #pragma once -namespace Aurora::IO +namespace Aurora::IO::Adapters { AUKN_SYM AuSPtr NewSeekingReadAdapter(const AuSPtr &pReader); } \ No newline at end of file diff --git a/Include/Aurora/IO/IOExperimental.hpp b/Include/Aurora/IO/IOExperimental.hpp index bc67bc78..b9a5d180 100644 --- a/Include/Aurora/IO/IOExperimental.hpp +++ b/Include/Aurora/IO/IOExperimental.hpp @@ -46,10 +46,10 @@ #include "IByteBufferStreamPair.hpp" -#include "IOAdapterAsyncStream.hpp" -#include "IOAdapterByteBuffer.hpp" -#include "IOAdapterCompression.hpp" -#include "IOAdapterSeeking.hpp" +#include "Adapters/IOAdapterAsyncStream.hpp" +#include "Adapters/IOAdapterByteBuffer.hpp" +#include "Adapters/IOAdapterCompression.hpp" +#include "Adapters/IOAdapterSeeking.hpp" #include "IIOWaitableTickLimiter.hpp" #include "IIOWaitableIOTimer.hpp" diff --git a/Source/IO/AuIOAdapterAsyncStream.cpp b/Source/IO/Adapters/AuIOAdapterAsyncStream.cpp similarity index 99% rename from Source/IO/AuIOAdapterAsyncStream.cpp rename to Source/IO/Adapters/AuIOAdapterAsyncStream.cpp index 03ccfae6..0065dcf3 100644 --- a/Source/IO/AuIOAdapterAsyncStream.cpp +++ b/Source/IO/Adapters/AuIOAdapterAsyncStream.cpp @@ -8,9 +8,9 @@ #include #include #include "AuIOAdapterAsyncStream.hpp" -#include "AuIOWaitableIOLoopSource.hpp" +#include "../AuIOWaitableIOLoopSource.hpp" -namespace Aurora::IO +namespace Aurora::IO::Adapters { struct AsyncStreamAdapter; diff --git a/Source/IO/AuIOAdapterAsyncStream.hpp b/Source/IO/Adapters/AuIOAdapterAsyncStream.hpp similarity index 84% rename from Source/IO/AuIOAdapterAsyncStream.hpp rename to Source/IO/Adapters/AuIOAdapterAsyncStream.hpp index bda2da87..116ba94f 100644 --- a/Source/IO/AuIOAdapterAsyncStream.hpp +++ b/Source/IO/Adapters/AuIOAdapterAsyncStream.hpp @@ -7,7 +7,7 @@ ***/ #pragma once -namespace Aurora::IO +namespace Aurora::IO::Adapters { } \ No newline at end of file diff --git a/Source/IO/AuIOAdapterByteBuffer.cpp b/Source/IO/Adapters/AuIOAdapterByteBuffer.cpp similarity index 97% rename from Source/IO/AuIOAdapterByteBuffer.cpp rename to Source/IO/Adapters/AuIOAdapterByteBuffer.cpp index ad6f8770..0b21a9e1 100644 --- a/Source/IO/AuIOAdapterByteBuffer.cpp +++ b/Source/IO/Adapters/AuIOAdapterByteBuffer.cpp @@ -9,7 +9,7 @@ #include #include "AuIOAdapterByteBuffer.hpp" -namespace Aurora::IO +namespace Aurora::IO::Adapters { AUKN_SYM AuSPtr NewByteBufferReadAdapter(const AuSPtr &pBuffer) { diff --git a/Source/IO/AuIOAdapterByteBuffer.hpp b/Source/IO/Adapters/AuIOAdapterByteBuffer.hpp similarity index 84% rename from Source/IO/AuIOAdapterByteBuffer.hpp rename to Source/IO/Adapters/AuIOAdapterByteBuffer.hpp index 32d88d63..62cba029 100644 --- a/Source/IO/AuIOAdapterByteBuffer.hpp +++ b/Source/IO/Adapters/AuIOAdapterByteBuffer.hpp @@ -7,7 +7,7 @@ ***/ #pragma once -namespace Aurora::IO +namespace Aurora::IO::Adapters { } \ No newline at end of file diff --git a/Source/IO/AuIOAdapterCompression.cpp b/Source/IO/Adapters/AuIOAdapterCompression.cpp similarity index 99% rename from Source/IO/AuIOAdapterCompression.cpp rename to Source/IO/Adapters/AuIOAdapterCompression.cpp index 5ce6f03a..f8920c26 100644 --- a/Source/IO/AuIOAdapterCompression.cpp +++ b/Source/IO/Adapters/AuIOAdapterCompression.cpp @@ -9,7 +9,7 @@ #include #include "AuIOAdapterCompression.hpp" -namespace Aurora::IO +namespace Aurora::IO::Adapters { CompressionStreamReader::CompressionStreamReader(const AuSPtr &pCompressionStream) : pCompressionStream(pCompressionStream) diff --git a/Source/IO/AuIOAdapterCompression.hpp b/Source/IO/Adapters/AuIOAdapterCompression.hpp similarity index 97% rename from Source/IO/AuIOAdapterCompression.hpp rename to Source/IO/Adapters/AuIOAdapterCompression.hpp index f3b03f91..96ef673a 100644 --- a/Source/IO/AuIOAdapterCompression.hpp +++ b/Source/IO/Adapters/AuIOAdapterCompression.hpp @@ -7,7 +7,7 @@ ***/ #pragma once -namespace Aurora::IO +namespace Aurora::IO::Adapters { struct CompressionStreamReader : IStreamReader { diff --git a/Source/IO/AuIOAdapterSeeking.cpp b/Source/IO/Adapters/AuIOAdapterSeeking.cpp similarity index 97% rename from Source/IO/AuIOAdapterSeeking.cpp rename to Source/IO/Adapters/AuIOAdapterSeeking.cpp index 443cebc0..a3218eba 100644 --- a/Source/IO/AuIOAdapterSeeking.cpp +++ b/Source/IO/Adapters/AuIOAdapterSeeking.cpp @@ -9,7 +9,7 @@ #include #include "AuIOAdapterSeeking.hpp" -namespace Aurora::IO +namespace Aurora::IO::Adapters { SeekingReader::SeekingReader(const AuSPtr &pReader) : pReader(pReader) diff --git a/Source/IO/AuIOAdapterSeeking.hpp b/Source/IO/Adapters/AuIOAdapterSeeking.hpp similarity index 94% rename from Source/IO/AuIOAdapterSeeking.hpp rename to Source/IO/Adapters/AuIOAdapterSeeking.hpp index fccbef7c..93476817 100644 --- a/Source/IO/AuIOAdapterSeeking.hpp +++ b/Source/IO/Adapters/AuIOAdapterSeeking.hpp @@ -7,7 +7,7 @@ ***/ #pragma once -namespace Aurora::IO +namespace Aurora::IO::Adapters { struct SeekingReader : IStreamReader { diff --git a/Source/IO/AuIOPipeProcessor.cpp b/Source/IO/AuIOPipeProcessor.cpp index ed154246..028bc1ca 100644 --- a/Source/IO/AuIOPipeProcessor.cpp +++ b/Source/IO/AuIOPipeProcessor.cpp @@ -25,7 +25,7 @@ namespace Aurora::IO this->uBytesWrittenLimit_ = request.uLengthOrZero; this->uBytesWrittenTarget_ = request.uMinBytesToRead ? request.uMinBytesToRead : request.uLengthOrZero; this->pAsyncTransaction_ = request.pAsyncTransaction; - this->pAsyncAdapter_ = NewAsyncStreamAdapter(request.pAsyncTransaction, request.bIsStream); + this->pAsyncAdapter_ = Adapters::NewAsyncStreamAdapter(request.pAsyncTransaction, request.bIsStream); SysAssert(this->pAsyncAdapter_); this->pAsyncAdapter_->SetReadOffset(request.uStartOffset); this->pAsyncAdapter_->SetWriteOffset(request.uStartOffset); diff --git a/Source/IO/AuIOPipeProcessor.hpp b/Source/IO/AuIOPipeProcessor.hpp index 237066f4..17e39a82 100644 --- a/Source/IO/AuIOPipeProcessor.hpp +++ b/Source/IO/AuIOPipeProcessor.hpp @@ -93,8 +93,8 @@ namespace Aurora::IO { IOPipeInputData input_; AuSPtr pAsyncTransaction_; - AuSPtr pAsyncAdapter_; - AuSPtr pAsyncStreamReader_; + AuSPtr pAsyncAdapter_; + AuSPtr pAsyncStreamReader_; }; IOPipeCallback output; diff --git a/Source/IO/Buffered/BlobBuilder.cpp b/Source/IO/Buffered/BlobBuilder.cpp deleted file mode 100644 index 48691266..00000000 --- a/Source/IO/Buffered/BlobBuilder.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include "BlobBuilder.hpp" - -namespace Aurora::IO::Buffered -{ - -} \ No newline at end of file diff --git a/Source/IO/Buffered/BlobBuilder.hpp b/Source/IO/Buffered/BlobBuilder.hpp deleted file mode 100644 index 6c24f209..00000000 --- a/Source/IO/Buffered/BlobBuilder.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -namespace Aurora::IO::Buffered -{ - -} \ No newline at end of file