-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathImportManager.h
More file actions
40 lines (35 loc) · 1.28 KB
/
ImportManager.h
File metadata and controls
40 lines (35 loc) · 1.28 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
#ifndef IMPORTMANAGER_H
#define IMPORTMANAGER_H
#include <retroshare/rsplugin.h>
#include "jsoncpp/json/json.h"
class ImportManager
{
public:
/*!
* \brief ImportManager constructor
* \param mPeers Where imported peers will be added.
*/
ImportManager(RsPeers* mPeers);
/*!
* \brief Add peers to Retroshare from json string.
*
* Imports Retroshare peers into your retroshare profile from json data. The
* json data is expected to be formatted in the same specifications that
* ExportManager::exportData outputs. It will optionally import groups from
* the json data aswell.
*
* \param json_string Json data containing retroshare peers and, optionally,
* groups
* \param import_groups Whether or not groups should be imported as well.
*/
void importData(const std::string& json_string, bool import_groups);
private:
void importGPGIds(const Json::Value &gpg_ids);
void importSSLIds(const Json::Value &ssl_ids);
void importGroups(const Json::Value &groups);
void importSSLId(const Json::Value &json_ssl_id);
bool getGrpIdByName(const std::string &name, std::string &id);
bool getGrp(const std::string &name, const Json::Value &flag, std::string &id);
RsPeers* mPeers;
};
#endif // IMPORTMANAGER_H