mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
getMIConsoleStream() and getMILogStream() new methods.
This commit is contained in:
parent
6a389b25b5
commit
9a1e378aaa
1 changed files with 41 additions and 11 deletions
|
@ -64,8 +64,11 @@ public class MISession extends Observable {
|
||||||
CommandQueue rxQueue;
|
CommandQueue rxQueue;
|
||||||
Queue eventQueue;
|
Queue eventQueue;
|
||||||
|
|
||||||
PipedInputStream miInPipe;
|
PipedInputStream miInConsolePipe;
|
||||||
PipedOutputStream miOutPipe;
|
PipedOutputStream miOutConsolePipe;
|
||||||
|
PipedInputStream miInLogPipe;
|
||||||
|
PipedOutputStream miOutLogPipe;
|
||||||
|
|
||||||
|
|
||||||
CommandFactory factory;
|
CommandFactory factory;
|
||||||
|
|
||||||
|
@ -133,17 +136,31 @@ public class MISession extends Observable {
|
||||||
* get MI Console Stream.
|
* get MI Console Stream.
|
||||||
* The parser will make available the MI console stream output.
|
* The parser will make available the MI console stream output.
|
||||||
*/
|
*/
|
||||||
public InputStream getMIStream() {
|
public InputStream getMIConsoleStream() {
|
||||||
if (miInPipe == null) {
|
if (miInConsolePipe == null) {
|
||||||
try {
|
try {
|
||||||
miOutPipe = new PipedOutputStream();
|
miOutConsolePipe = new PipedOutputStream();
|
||||||
miInPipe = new PipedInputStream(miOutPipe);
|
miInConsolePipe = new PipedInputStream(miOutConsolePipe);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return miInPipe;
|
return miInConsolePipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get MI Console Stream.
|
||||||
|
* The parser will make available the MI console stream output.
|
||||||
|
*/
|
||||||
|
public InputStream getMILogStream() {
|
||||||
|
if (miInLogPipe == null) {
|
||||||
|
try {
|
||||||
|
miOutLogPipe = new PipedOutputStream();
|
||||||
|
miInLogPipe = new PipedInputStream(miOutLogPipe);
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return miInLogPipe;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For example the CDI/MI bridge uses the command
|
* For example the CDI/MI bridge uses the command
|
||||||
|
@ -349,9 +366,18 @@ public class MISession extends Observable {
|
||||||
|
|
||||||
// Destroy the MI console stream.
|
// Destroy the MI console stream.
|
||||||
try {
|
try {
|
||||||
miInPipe = null;
|
miInConsolePipe = null;
|
||||||
if (miOutPipe != null) {
|
if (miOutConsolePipe != null) {
|
||||||
miOutPipe.close();
|
miOutConsolePipe.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Destroy the MI log stream.
|
||||||
|
try {
|
||||||
|
miInLogPipe = null;
|
||||||
|
if (miOutLogPipe != null) {
|
||||||
|
miOutLogPipe.close();
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
|
@ -394,7 +420,11 @@ public class MISession extends Observable {
|
||||||
|
|
||||||
|
|
||||||
OutputStream getConsolePipe() {
|
OutputStream getConsolePipe() {
|
||||||
return miOutPipe;
|
return miOutConsolePipe;
|
||||||
|
}
|
||||||
|
|
||||||
|
OutputStream getLogPipe() {
|
||||||
|
return miOutLogPipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandQueue getTxQueue() {
|
CommandQueue getTxQueue() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue