X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=CollectionReader.h;h=023b226cfd7ca86a17b25302587c6983b82b6f59;hb=e4f9c67cc94df1e370846b19ddedd4365df7b638;hp=5e10c51b021cbb436193d331d4413d00294ca1f4;hpb=5f35ee49184899c1bfffe4d788286b7c9b578c00;p=ecparse.git diff --git a/CollectionReader.h b/CollectionReader.h index 5e10c51..023b226 100644 --- a/CollectionReader.h +++ b/CollectionReader.h @@ -4,7 +4,13 @@ #pragma once +#include #include "ReaderInput.h" +#include "ED2KLink.h" +#include "GrowingBuffer.h" +#include "StringTag.h" +#include "BlobTag.h" +#include "HashTag.h" class CollectionReader { @@ -12,8 +18,26 @@ public: CollectionReader(ReaderInput* readerInput); ~CollectionReader(); + ED2KLink* getNextLink(); + +private: + void identifyCollectionType(); + bool isLineBreakPresent(); + bool ensureBufferCapacity(size_t byteCount); + void readMoreBytes(); + + BlobTag* readBlobTag(bool header = false); + StringTag* readStringTag(bool header = false); + HashTag* readHashTag(); + private: ReaderInput* readerInput; + GrowingBuffer growingBuffer; + uint32_t version; + bool firstLink; + bool isTextCollection; + uint32_t fileCollectionCount; + uint32_t collectionFileIndex; };