parse header tags
[ecparse.git] / CollectionReader.h
1 /**
2  * © 2008 by David Roden <droden@gmail.com>
3  */
4
5 #pragma once
6
7 #include "ReaderInput.h"
8 #include "ED2KLink.h"
9 #include "GrowingBuffer.h"
10 #include "StringTag.h"
11 #include "BlobTag.h"
12
13 class CollectionReader {
14
15 public:
16         CollectionReader(ReaderInput* readerInput);
17         ~CollectionReader();
18
19         ED2KLink* getNextLink();
20
21 private:
22         void identifyCollectionType();
23         bool isLineBreakPresent();
24         bool ensureBufferCapacity(size_t byteCount);
25         void readMoreBytes();
26
27         BlobTag* readBlobTag(bool hader);
28         StringTag* readStringTag(bool header);
29
30 private:
31         ReaderInput* readerInput;
32         GrowingBuffer growingBuffer;
33         int version;
34         bool firstLink;
35         bool isTextCollection;
36
37 };
38