increase version number to 0.1
[ecparse.git] / CollectionReader.h
index 2936e25..023b226 100644 (file)
@@ -2,10 +2,15 @@
  * © 2008 by David Roden <droden@gmail.com>
  */
 
-#ifndef __ECPARSE_COLLECTIONREADER_H__
-#define __ECPARSE_COLLECTIONREADER_H__
+#pragma once
 
+#include <stdint.h>
 #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