monotone

monotone Mtn Source Tree

Root/botan/datastor.h

1/*************************************************
2* Data Store Header File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_DATA_STORE_H__
7#define BOTAN_DATA_STORE_H__
8
9#include <botan/secmem.h>
10#include <utility>
11#include <string>
12#include <vector>
13#include <map>
14
15namespace Botan {
16
17/*************************************************
18* Data Store *
19*************************************************/
20class Data_Store
21 {
22 public:
23 class Matcher
24 {
25 public:
26 virtual bool operator()(const std::string&,
27 const std::string&) const = 0;
28
29 virtual std::pair<std::string, std::string>
30 transform(const std::string&, const std::string&) const;
31
32 virtual ~Matcher() {}
33 };
34
35 bool operator==(const Data_Store&) const;
36
37 std::multimap<std::string, std::string>
38 search_with(const Matcher&) const;
39
40 std::vector<std::string> get(const std::string&) const;
41
42 std::string get1(const std::string&) const;
43
44 MemoryVector<byte> get1_memvec(const std::string&) const;
45 u32bit get1_u32bit(const std::string&, u32bit = 0) const;
46
47 bool has_value(const std::string&) const;
48
49 void add(const std::multimap<std::string, std::string>&);
50 void add(const std::string&, const std::string&);
51 void add(const std::string&, u32bit);
52 void add(const std::string&, const MemoryRegion<byte>&);
53 private:
54 std::multimap<std::string, std::string> contents;
55 };
56
57}
58
59#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status