X-Git-Url: https://git.pterodactylus.net/?p=ecparse.git;a=blobdiff_plain;f=CollectionReader.h;h=023b226cfd7ca86a17b25302587c6983b82b6f59;hp=2936e2573982ba02e594aaf11426d7b881bbf87d;hb=HEAD;hpb=e1f64147e3eedccbbc59658ddb6cf7992dbd50c1 diff --git a/CollectionReader.h b/CollectionReader.h index 2936e25..023b226 100644 --- a/CollectionReader.h +++ b/CollectionReader.h @@ -2,10 +2,15 @@ * © 2008 by David Roden */ -#ifndef __ECPARSE_COLLECTIONREADER_H__ -#define __ECPARSE_COLLECTIONREADER_H__ +#pragma once +#include #include "ReaderInput.h" +#include "ED2KLink.h" +#include "GrowingBuffer.h" +#include "StringTag.h" +#include "BlobTag.h" +#include "HashTag.h" class CollectionReader { @@ -13,9 +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; }; -#endif