org.fusesource.jansi.internal.WindowsSupport.getLastErrorMessage()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中org.fusesource.jansi.internal.WindowsSupport.getLastErrorMessage()方法的一些代码示例,展示了WindowsSupport.getLastErrorMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowsSupport.getLastErrorMessage()方法的具体详情如下:
包路径:org.fusesource.jansi.internal.WindowsSupport
类名称:WindowsSupport
方法名:getLastErrorMessage

WindowsSupport.getLastErrorMessage介绍

暂无

代码示例

代码示例来源:origin: org.jline/jline

  1. @Override
  2. protected void writeConsole(char[] text, int len) throws IOException {
  3. if (WriteConsoleW(console, text, len, writtenChars, 0) == 0) {
  4. throw new IOException("Failed to write to console: " + WindowsSupport.getLastErrorMessage());
  5. }
  6. }

代码示例来源:origin: org.jline/jline

  1. private void applyCursorPosition() throws IOException {
  2. info.cursorPosition.x = (short) Math.max(0, Math.min(info.size.x - 1, info.cursorPosition.x));
  3. info.cursorPosition.y = (short) Math.max(0, Math.min(info.size.y - 1, info.cursorPosition.y));
  4. if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
  5. throw new IOException(WindowsSupport.getLastErrorMessage());
  6. }
  7. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. private void applyAttribute() throws IOException {
  2. out.flush(); // expected diff with WindowsAnsiPrintStream.java
  3. short attributes = info.attributes;
  4. if (negative) {
  5. attributes = invertAttributeColors(attributes);
  6. }
  7. if (SetConsoleTextAttribute(console, attributes) == 0) {
  8. throw new IOException(WindowsSupport.getLastErrorMessage());
  9. }
  10. }

代码示例来源:origin: org.jline/jline

  1. private void getConsoleInfo() throws IOException {
  2. out.flush();
  3. if (GetConsoleScreenBufferInfo(console, info) == 0) {
  4. throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
  5. }
  6. if (negative) {
  7. info.attributes = invertAttributeColors(info.attributes);
  8. }
  9. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. private void applyAttribute() throws IOException {
  2. ps.flush(); // expected diff with WindowsAnsiOutputStream.java
  3. short attributes = info.attributes;
  4. if (negative) {
  5. attributes = invertAttributeColors(attributes);
  6. }
  7. if (SetConsoleTextAttribute(console, attributes) == 0) {
  8. throw new IOException(WindowsSupport.getLastErrorMessage());
  9. }
  10. }

代码示例来源:origin: org.gradle/gradle-logging

  1. private void applyCursorPosition() throws IOException {
  2. if (SetConsoleCursorPosition(CONSOLE, info.cursorPosition.copy()) == 0) {
  3. throw new IOException(WindowsSupport.getLastErrorMessage());
  4. }
  5. }

代码示例来源:origin: org.gradle/gradle-logging

  1. private void getConsoleInfo() throws IOException {
  2. out.flush();
  3. if (GetConsoleScreenBufferInfo(CONSOLE, info) == 0) {
  4. throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
  5. }
  6. if (negative) {
  7. info.attributes = invertAttributeColors(info.attributes);
  8. }
  9. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. private void getConsoleInfo() throws IOException {
  2. ps.flush(); // expected diff with WindowsAnsiOutputStream.java
  3. if (GetConsoleScreenBufferInfo(console, info) == 0) {
  4. throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
  5. }
  6. if (negative) {
  7. info.attributes = invertAttributeColors(info.attributes);
  8. }
  9. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. private void getConsoleInfo() throws IOException {
  2. out.flush(); // expected diff with WindowsAnsiPrintStream.java
  3. if (GetConsoleScreenBufferInfo(console, info) == 0) {
  4. throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
  5. }
  6. if (negative) {
  7. info.attributes = invertAttributeColors(info.attributes);
  8. }
  9. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. private void applyCursorPosition() throws IOException {
  2. if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
  3. throw new IOException(WindowsSupport.getLastErrorMessage());
  4. }
  5. }

代码示例来源:origin: org.aesh/aesh-readline

  1. @Override
  2. public void accept(int[] input) {
  3. CharBuffer buffer = Encoder.toCharBuffer(input);
  4. char[] chars = buffer.array();
  5. if (WriteConsoleW(console, chars, chars.length, writtenChars, 0) == 0) {
  6. LOGGER.log(Level.WARNING, "Failed to write out.", WindowsSupport.getLastErrorMessage());
  7. }
  8. }

代码示例来源:origin: org.gradle/gradle-logging

  1. private void applyAttribute() throws IOException {
  2. out.flush();
  3. short attributes = info.attributes;
  4. if (negative) {
  5. attributes = invertAttributeColors(attributes);
  6. }
  7. if (SetConsoleTextAttribute(CONSOLE, attributes) == 0) {
  8. throw new IOException(WindowsSupport.getLastErrorMessage());
  9. }
  10. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. private void applyCursorPosition() throws IOException {
  2. if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
  3. throw new IOException(WindowsSupport.getLastErrorMessage());
  4. }
  5. }

代码示例来源:origin: org.jline/jline

  1. @Override
  2. public Cursor getCursorPosition(IntConsumer discarded) {
  3. CONSOLE_SCREEN_BUFFER_INFO info = new CONSOLE_SCREEN_BUFFER_INFO();
  4. long console = GetStdHandle(STD_OUTPUT_HANDLE);
  5. if (GetConsoleScreenBufferInfo(console, info) == 0) {
  6. throw new IOError(new IOException("Could not get the cursor position: " + WindowsSupport.getLastErrorMessage()));
  7. }
  8. return new Cursor(info.cursorPosition.x, info.cursorPosition.y);
  9. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. @Override
  2. protected void processInsertLine(int optionInt) throws IOException {
  3. getConsoleInfo();
  4. SMALL_RECT scroll = info.window.copy();
  5. scroll.top = info.cursorPosition.y;
  6. COORD org = new COORD();
  7. org.x = 0;
  8. org.y = (short)(info.cursorPosition.y + optionInt);
  9. CHAR_INFO info = new CHAR_INFO();
  10. info.attributes = originalColors;
  11. info.unicodeChar = ' ';
  12. if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
  13. throw new IOException(WindowsSupport.getLastErrorMessage());
  14. }
  15. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. @Override
  2. protected void processDeleteLine(int optionInt) throws IOException {
  3. getConsoleInfo();
  4. SMALL_RECT scroll = info.window.copy();
  5. scroll.top = info.cursorPosition.y;
  6. COORD org = new COORD();
  7. org.x = 0;
  8. org.y = (short)(info.cursorPosition.y - optionInt);
  9. CHAR_INFO info = new CHAR_INFO();
  10. info.attributes = originalColors;
  11. info.unicodeChar = ' ';
  12. if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
  13. throw new IOException(WindowsSupport.getLastErrorMessage());
  14. }
  15. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. @Override
  2. protected void processDeleteLine(int optionInt) throws IOException {
  3. getConsoleInfo();
  4. SMALL_RECT scroll = info.window.copy();
  5. scroll.top = info.cursorPosition.y;
  6. COORD org = new COORD();
  7. org.x = 0;
  8. org.y = (short)(info.cursorPosition.y - optionInt);
  9. CHAR_INFO info = new CHAR_INFO();
  10. info.attributes = originalColors;
  11. info.unicodeChar = ' ';
  12. if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
  13. throw new IOException(WindowsSupport.getLastErrorMessage());
  14. }
  15. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. @Override
  2. protected void processInsertLine(int optionInt) throws IOException {
  3. getConsoleInfo();
  4. SMALL_RECT scroll = info.window.copy();
  5. scroll.top = info.cursorPosition.y;
  6. COORD org = new COORD();
  7. org.x = 0;
  8. org.y = (short)(info.cursorPosition.y + optionInt);
  9. CHAR_INFO info = new CHAR_INFO();
  10. info.attributes = originalColors;
  11. info.unicodeChar = ' ';
  12. if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
  13. throw new IOException(WindowsSupport.getLastErrorMessage());
  14. }
  15. }

代码示例来源:origin: org.jline/jline

  1. @Override
  2. protected void processInsertLine(int optionInt) throws IOException {
  3. getConsoleInfo();
  4. SMALL_RECT scroll = info.window.copy();
  5. scroll.top = info.cursorPosition.y;
  6. COORD org = new COORD();
  7. org.x = 0;
  8. org.y = (short)(info.cursorPosition.y + optionInt);
  9. CHAR_INFO info = new CHAR_INFO();
  10. info.attributes = originalColors;
  11. info.unicodeChar = ' ';
  12. if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
  13. throw new IOException(WindowsSupport.getLastErrorMessage());
  14. }
  15. }

代码示例来源:origin: org.jline/jline

  1. @Override
  2. protected void processDeleteLine(int optionInt) throws IOException {
  3. getConsoleInfo();
  4. SMALL_RECT scroll = info.window.copy();
  5. scroll.top = info.cursorPosition.y;
  6. COORD org = new COORD();
  7. org.x = 0;
  8. org.y = (short)(info.cursorPosition.y - optionInt);
  9. CHAR_INFO info = new CHAR_INFO();
  10. info.attributes = originalColors;
  11. info.unicodeChar = ' ';
  12. if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
  13. throw new IOException(WindowsSupport.getLastErrorMessage());
  14. }
  15. }

相关文章