Botan 1.10.17

datastor.h
Go to the documentation of this file.
1 /*
2 * Data Store
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_DATA_STORE_H__
9 #define BOTAN_DATA_STORE_H__
10
11 #include <botan/secmem.h>
12 #include <utility>
13 #include <string>
14 #include <vector>
15 #include <map>
16
17 namespace Botan {
18
19 /**
20 * Data Store
21 */
22 class BOTAN_DLL Data_Store
23 {
24 public:
25 /**
26 * A search function
27 */
28 class BOTAN_DLL Matcher
29 {
30 public:
31 virtual bool operator()(const std::string&,
32 const std::string&) const = 0;
33
34 virtual std::pair<std::string, std::string>
35 transform(const std::string&, const std::string&) const;
36
37 virtual ~Matcher() {}
38 };
39
40 bool operator==(const Data_Store&) const;
41
42 std::multimap<std::string, std::string>
43 search_with(const Matcher&) const;
44
45 std::vector<std::string> get(const std::string&) const;
46
47 std::string get1(const std::string&) const;
48
49 MemoryVector<byte> get1_memvec(const std::string&) const;
50 u32bit get1_u32bit(const std::string&, u32bit = 0) const;
51
52 bool has_value(const std::string&) const;
53
54 void add(const std::multimap<std::string, std::string>&);
55 void add(const std::string&, const std::string&);
56 void add(const std::string&, u32bit);
57 void add(const std::string&, const MemoryRegion<byte>&);
58 private:
59 std::multimap<std::string, std::string> contents;
60 };
61
62 }
63
64 #endif
transform
#define transform(B0, B1, B2, B3)
Definition: serp_simd.cpp:441
Botan::operator==
bool operator==(const OctetString &s1, const OctetString &s2)
Definition: symkey.cpp:98
Botan::MemoryRegion< byte >
Botan
Definition: algo_base.h:14
Botan::MemoryVector< byte >
Botan::Data_Store::Matcher
Definition: datastor.h:28
Botan::Data_Store
Definition: datastor.h:22
Botan::Data_Store::Matcher::~Matcher
virtual ~Matcher()
Definition: datastor.h:37
Botan::u32bit
unsigned int u32bit
Definition: types.h:32