From: David ‘Bombe’ Roden Date: Sun, 6 Jul 2008 10:08:46 +0000 (+0200) Subject: add hash tag X-Git-Tag: 0.1~5 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9e05ba27c55c17cb1a2f5345553bad9cb0b1da15;p=ecparse.git add hash tag --- diff --git a/HashTag.cpp b/HashTag.cpp new file mode 100644 index 0000000..f6fd7fa --- /dev/null +++ b/HashTag.cpp @@ -0,0 +1,20 @@ +/** + * © 2008 by David ‘Bombe’ Roden + */ + +#include "HashTag.h" + +#include + +HashTag::HashTag(const char* hash): Tag(Hash, 0) { + memcpy(this->hash, hash, 16); +} + +int HashTag::getSize() { + return 16; +} + +void* HashTag::getValue() { + return hash; +} + diff --git a/HashTag.h b/HashTag.h new file mode 100644 index 0000000..abcf98b --- /dev/null +++ b/HashTag.h @@ -0,0 +1,21 @@ +/** + * © 2008 by David ‘Bombe’ Roden + */ + +#pragma once + +#include "Tag.h" + +class HashTag: public Tag { + +public: + HashTag(const char* hash); + + int getSize(); + void* getValue(); + +private: + char hash[16]; + +}; + diff --git a/Makefile b/Makefile index b7fda71..60d0734 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ endif all: ecparse -ecparse: Tag.o BlobTag.o StringTag.o GlobalSettings.o GrowingBuffer.o ED2KLink.o ReaderInput.o FileReaderInput.o CollectionReader.o Main.o +ecparse: Tag.o HashTag.o BlobTag.o StringTag.o GlobalSettings.o GrowingBuffer.o ED2KLink.o ReaderInput.o FileReaderInput.o CollectionReader.o Main.o $(CC) -o $@ $^ GlobalSettings.o: GlobalSettings.cpp GlobalSettings.h @@ -29,7 +29,9 @@ StringTag.o: StringTag.cpp StringTag.h Tag.h TagType.h BlobTag.o: BlobTag.cpp BlobTag.h Tag.h TagType.h -CollectionReader.o: CollectionReader.cpp ReaderInput.h ED2KLink.h GrowingBuffer.h GlobalSettings.h Tag.h TagType.h StringTag.h BlobTag.h +HashTag.o: HashTag.cpp HashTag.h Tag.h + +CollectionReader.o: CollectionReader.cpp ReaderInput.h ED2KLink.h GrowingBuffer.h GlobalSettings.h Tag.h TagType.h StringTag.h BlobTag.h HashTag.h ED2KLink.o: ED2KLink.cpp ED2KLink.h GlobalSettings.h