--- /dev/null
+/**
+ * © 2008 by David Roden <droden@gmail.com>
+ */
+
+#include "StringTag.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+StringTag::StringTag(int id, const char* value): Tag(String, id) {
+ this->value = (char*) malloc(strlen(value) + 1);
+ strcpy(this->value, value);
+}
+
+StringTag::~StringTag() {
+ if (value) {
+ free(value);
+ }
+}
+
+void* StringTag::getValue() {
+ return value;
+}
+
--- /dev/null
+/**
+ * © 2008 by David Roden <droden@gmail.com>
+ */
+
+#pragma once
+
+#include "Tag.h"
+
+class StringTag: public Tag {
+
+public:
+ StringTag(int id, const char* value);
+ ~StringTag();
+
+ void* getValue();
+
+private:
+ char* value;
+
+};
+
--- /dev/null
+/**
+ * © 2008 by David Roden <droden@gmail.com>
+ */
+
+#include "Tag.h"
+
+Tag::Tag(TagType type, int id) {
+ this->type = type;
+ this->id = id;
+}
+
+Tag::~Tag() {
+}
+
+TagType Tag::getType() {
+ return type;
+}
+
+int Tag::getId() {
+ return id;
+}
+
--- /dev/null
+/**
+ * © 2008 by David Roden <droden@gmail.com>
+ */
+
+#pragma once
+
+#include "TagType.h"
+
+class Tag {
+
+protected:
+ Tag(TagType type, int id);
+ virtual ~Tag();
+
+public:
+ TagType getType();
+ int getId();
+ virtual void* getValue() = 0;
+
+private:
+ TagType type;
+ int id;
+
+};
+
--- /dev/null
+/**
+ * © 2008 by David Roden <droden@gmail.com>
+ */
+
+#pragma once
+
+enum TagType {
+ String, Blob, Hash, UInt32, UInt16, UInt8, UInt64
+};
+