aboutsummaryrefslogtreecommitdiffstats
path: root/include/datastor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/datastor.h')
-rw-r--r--include/datastor.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/include/datastor.h b/include/datastor.h
new file mode 100644
index 000000000..86a607feb
--- /dev/null
+++ b/include/datastor.h
@@ -0,0 +1,55 @@
+/*************************************************
+* Data Store Header File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_DATA_STORE_H__
+#define BOTAN_DATA_STORE_H__
+
+#include <botan/secmem.h>
+#include <utility>
+#include <string>
+#include <vector>
+#include <map>
+
+namespace Botan {
+
+/*************************************************
+* Data Store *
+*************************************************/
+class Data_Store
+ {
+ public:
+ class Matcher
+ {
+ public:
+ virtual bool operator()(const std::string&,
+ const std::string&) const = 0;
+
+ virtual std::pair<std::string, std::string>
+ transform(const std::string&, const std::string&) const;
+
+ virtual ~Matcher() {}
+ };
+
+ bool operator==(const Data_Store&) const;
+
+ std::multimap<std::string, std::string> get(const Matcher&) const;
+ std::vector<std::string> get(const std::string&) const;
+
+ std::string get1(const std::string&) const;
+
+ MemoryVector<byte> get1_memvec(const std::string&) const;
+ u32bit get1_u32bit(const std::string&, u32bit = 0) const;
+
+ void add(const std::multimap<std::string, std::string>&);
+ void add(const std::string&, const std::string&);
+ void add(const std::string&, u32bit);
+ void add(const std::string&, const MemoryRegion<byte>&);
+ private:
+ std::multimap<std::string, std::string> contents;
+ };
+
+}
+
+#endif