X-Git-Url: https://git.pterodactylus.net/?p=ecparse.git;a=blobdiff_plain;f=CollectionReader.cpp;fp=CollectionReader.cpp;h=00427ffab6800bbb73ad2c0d4894e0e3977b0c32;hp=ffbb89c806839620a2bcc256414b0b92be9162e9;hb=e4f9c67cc94df1e370846b19ddedd4365df7b638;hpb=005e134568b5c77ec880481ec66f78b22c1cd6f2 diff --git a/CollectionReader.cpp b/CollectionReader.cpp index ffbb89c..00427ff 100644 --- a/CollectionReader.cpp +++ b/CollectionReader.cpp @@ -83,6 +83,21 @@ BlobTag* CollectionReader::readBlobTag(bool header) { return blobTag; } +HashTag* CollectionReader::readHashTag() { + if (!ensureBufferCapacity(1)) { + return NULL; + } + uint8_t tagId = 0; + growingBuffer.read(&tagId, 1); + GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] read tag id %d.\n", __FILE__, __LINE__, tagId); + if (!ensureBufferCapacity(16)) { + return NULL; + } + char hash[16]; + growingBuffer.read(hash, 16); + return new HashTag(tagId, hash); +} + ED2KLink* CollectionReader::getNextLink() { if (readerInput->isEOF() && !growingBuffer.getRemaining()) { GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] readInput EOF reached.\n", __FILE__, __LINE__);