aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormescalinum <mescalinum@users.sourceforge.net>2009-10-02 15:45:04 +0000
committermescalinum <mescalinum@users.sourceforge.net>2009-10-02 15:45:04 +0000
commit610f8eabfba4bd606adbb9a8305672f1a7b1c870 (patch)
tree0b334e4d1af161528580a5f70dc0eed21b63c582
parentb76b780729c13ab14c6156d36305ed3cbaafdb8a (diff)
forgot 1 thing
svn path=/trunk/externals/ffext/; revision=12511
-rw-r--r--composer/HasMeta.cpp16
-rw-r--r--composer/HasMeta.hpp24
2 files changed, 40 insertions, 0 deletions
diff --git a/composer/HasMeta.cpp b/composer/HasMeta.cpp
new file mode 100644
index 0000000..b80c941
--- /dev/null
+++ b/composer/HasMeta.cpp
@@ -0,0 +1,16 @@
+#include "HasMeta.hpp"
+
+bool HasMeta::hasMeta(const string &key)
+{
+ return meta.find(key) != meta.end();
+}
+
+const string HasMeta::getMeta(const string &key)
+{
+ return hasMeta(key) ? meta[key] : "";
+}
+
+void HasMeta::setMeta(const string &key, const string &value)
+{
+ meta[key] = value;
+}
diff --git a/composer/HasMeta.hpp b/composer/HasMeta.hpp
new file mode 100644
index 0000000..5bd74bb
--- /dev/null
+++ b/composer/HasMeta.hpp
@@ -0,0 +1,24 @@
+#ifndef COMPOSER_HASMETA_H_INCLUDED
+#define COMPOSER_HASMETA_H_INCLUDED
+
+#include <map>
+#include <string>
+
+using std::map;
+using std::string;
+
+class HasMeta
+{
+private:
+ map<string,string> meta;
+public:
+ bool hasMeta(const string &key);
+ const string getMeta(const string &key);
+ void setMeta(const string &key, const string &value);
+
+ typedef map<string,string>::const_iterator meta_iterator;
+ inline meta_iterator meta_begin() const {return meta.begin();}
+ inline meta_iterator meta_end() const {return meta.end();}
+};
+
+#endif // COMPOSER_HASMETA_H_INCLUDED