ночные изменения,+ исправление бага с иконкой сравнения

This commit is contained in:
2024-04-09 15:23:35 +03:00
parent 4e503d3b9b
commit 3d70efe253
11 changed files with 180 additions and 44 deletions

View File

@@ -218,7 +218,8 @@ public class ShellParser {
}
} while (!state.equals(ShellParserState.End));
}
public static void ReadLine(InputStreamReader fromServer) {
public static String ReadLine(InputStreamReader fromServer) {
StringBuilder res = new StringBuilder();
state = ShellParserState.NewLine;
do {
try {
@@ -229,7 +230,11 @@ public class ShellParser {
case '\r':
break;
case '\n':
return;
state = ShellParserState.End;
break;
default:
res.append(c);
break;
}
} else
state = ShellParserState.End;
@@ -238,6 +243,31 @@ public class ShellParser {
state = ShellParserState.End;
}
} while (!state.equals(ShellParserState.End));
return res.toString();
}
public static void ReadCommand(String command, InputStreamReader fromServer){
StringBuilder res = new StringBuilder();
do {
try {
if (fromServer.read(buffer) >= 0) {
c = buffer[0];
printChar();
switch (c) {
case '\r':
break;
case '\n':
break;
default:
res.append(c);
break;
}
} else
return;
} catch (Exception ex) {
Global.Log.PrintException(ex);
return;
}
} while (!res.toString().contains(command));
}
public static String getCommandResult(InputStreamReader fromServer) {
//если последняя строка ответа - кончается на приглашение, то ничего не делаем.