You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
59 lines
1.4 KiB
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
#include "Adapter.hh"
|
|
|
|
namespace pEp {
|
|
namespace Test {
|
|
using namespace std;
|
|
|
|
// manually set up test
|
|
void setup(vector<string>& args);
|
|
|
|
// call this in main() for auto set up
|
|
void setup(int argc=1, char **argv=nullptr);
|
|
|
|
void import_key_from_file(string filename);
|
|
|
|
using Message = shared_ptr<::message>;
|
|
using Identity= shared_ptr<::pEp_identity>;
|
|
|
|
// use this instead of constructor to auto assign ::free_message as
|
|
// deleter
|
|
Message make_message(::message *msg);
|
|
|
|
// use this instead of constructor to auto assign ::free_identity as
|
|
// deleter
|
|
Identity make_identity(::pEp_identity *ident);
|
|
|
|
// MIME parser
|
|
Message mime_parse(string text);
|
|
|
|
// MIME composer
|
|
string mime_compose(Message msg);
|
|
|
|
// Sync and Distribution decoder
|
|
string make_pEp_msg(Message msg);
|
|
|
|
// wait until Sync has shut down
|
|
void join_sync_thread();
|
|
|
|
struct Transport {
|
|
string inbox_path = "inbox";
|
|
string outbox_path = "outbox";
|
|
|
|
// reads next message from inbox
|
|
Message recv();
|
|
|
|
// appends message to outbox
|
|
void send(Message msg);
|
|
};
|
|
|
|
extern Transport transport;
|
|
extern string path;
|
|
};
|
|
};
|
|
|
|
|