summaryrefslogtreecommitdiff
blob: b72d47005f019ef860d434b9664a916c5e3f3704 (plain)
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 FILEZILLA_FZPUTTYGEN_INTERFACE_HEADER
#define FILEZILLA_FZPUTTYGEN_INTERFACE_HEADER

#include <wx/process.h>

class CFZPuttyGenInterface
{
public:
	CFZPuttyGenInterface(wxWindow* parent);
	virtual ~CFZPuttyGenInterface();
	bool LoadKeyFile(wxString& keyFile, bool silent, wxString& comment, wxString& data);

	void EndProcess();
	void DeleteProcess();
	bool IsProcessCreated();
	bool IsProcessStarted();

protected:
	// return -1 on error
	int NeedsConversion(wxString keyFile, bool silent);

	// return -1 on error
	int IsKeyFileEncrypted(wxString keyFile, bool silent);

	wxProcess* m_pProcess{};
	bool m_initialized{};
	wxWindow* m_parent;
	
	enum ReplyCode {
		success,
		error,
		failure
	};

	bool LoadProcess(bool silent);
	bool Send(const wxString& cmd);
	ReplyCode GetReply(wxString& reply);
};

#endif /* FILEZILLA_FZPUTTYGEN_INTERFACE_HEADER */