-
Notifications
You must be signed in to change notification settings - Fork 1
/
process.cpp
48 lines (36 loc) · 1.04 KB
/
process.cpp
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
47
48
#include "process.h"
#include <wx/txtstrm.h>
#include <wx/fs_mem.h>
#include <wx/msgdlg.h>
// ----------------------------------------------------------------------------
// MarkdownProcess
// ----------------------------------------------------------------------------
bool MarkdownProcess::HasInput()
{
bool hasInput = false;
if ( IsInputAvailable() )
{
wxTextInputStream tis(*GetInputStream());
// this assumes that the output is always line buffered
m_file << tis.ReadLine() << wxT("\n");
// m_parent->GetLogListBox()->Append(msg);
hasInput = true;
}
if ( IsErrorAvailable() )
{
wxTextInputStream tis(*GetErrorStream());
// this assumes that the output is always line buffered
wxMessageBox(tis.ReadLine());
hasInput = true;
}
return hasInput;
}
void MarkdownProcess::OnTerminate(int pid, int status)
{
// show the rest of the output
while ( HasInput() )
;
//wxMemoryFSHandler::AddFile("temp.html", m_file);
m_parent->DoIt();
delete this;
}