add tags
[ecparse.git] / StringTag.cpp
diff --git a/StringTag.cpp b/StringTag.cpp
new file mode 100644 (file)
index 0000000..d7482f0
--- /dev/null
@@ -0,0 +1,24 @@
+/**
+ * © 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;
+}
+