-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDatabase.hpp
35 lines (29 loc) · 930 Bytes
/
Database.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <memory>
#include <string>
#include <vector>
#include <unordered_map>
#include "DataBaseConnection.hpp"
#include "Document.hpp"
namespace CCC {
class Database {
private:
struct {
std::shared_ptr<DataBaseConnection> connection;
std::string name;
} data;
public:
typedef DataBaseConnection::DeleteDocumentResult DeleteResult;
typedef std::unordered_map<std::string, std::string> Map;
Database(std::shared_ptr<DataBaseConnection> connection, const std::string &name);
Document createDocument(const json &content, std::string uuid = ""s);
Document createDocument(const json &content);
DeleteResult removeDocument(Document &document);
std::vector<Document> documents();
std::vector<std::string> findDocument(const Map &map);
std::string name();
bool compact();
long maximalNumberOfRevisions();
bool setMaximalNumberOfRevisions(const long count);
};
}