aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/datastor/datastor.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-07-16 15:07:59 +0000
committerlloyd <[email protected]>2009-07-16 15:07:59 +0000
commitbd58db8eb1384fe26222d021325382f57f178cc7 (patch)
treeb54713202d613e88407279e5319a97126e894d2a /src/utils/datastor/datastor.h
parent1172c616fa849af893c1935b8b1dee085f8aaac8 (diff)
Move some files around to break up dependencies between directories
Diffstat (limited to 'src/utils/datastor/datastor.h')
-rw-r--r--src/utils/datastor/datastor.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/utils/datastor/datastor.h b/src/utils/datastor/datastor.h
new file mode 100644
index 000000000..7ee626fda
--- /dev/null
+++ b/src/utils/datastor/datastor.h
@@ -0,0 +1,61 @@
+/*
+* Data Store
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#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 BOTAN_DLL Data_Store
+ {
+ public:
+ class BOTAN_DLL 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>
+ search_with(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;
+
+ bool has_value(const std::string&) 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