-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAttachment.h
More file actions
47 lines (37 loc) · 1.14 KB
/
Attachment.h
File metadata and controls
47 lines (37 loc) · 1.14 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
/*
* File: Attachment.h
* Created on 27 luglio 2018
*/
#ifndef ATTACHMENT_H
#define ATTACHMENT_H
#include <vector>
#include "EventDispatcher.h"
#include "fb-wrapper.h"
class Transaction;
class Statement;
class Attachment {
friend class Transaction;
friend class Statement;
public:
Attachment();
void setParameter(std::string server, std::string database, std::string username, std::string password, std::string charset);
void createDatabase(std::string server, std::string database, std::string username, std::string password, std::string charset);
virtual ~Attachment();
void connect();
void disconnect();
void startTransaction();
IAttachment* getHandle();
EventDispatcher<DBStateEvents> dispatcher;
private:
IAttachment* att_ = nullptr;
ThrowStatusWrapper* status = nullptr;
IXpbBuilder* dpb = nullptr;
std::string server;
std::string database;
std::string username;
std::string password;
std::string charset;
std::string connectionString;
};
extern void formatExceptionMessage(const FbException& error, char *msg, unsigned int len);
#endif /* ATTACHMENT_H */