net.digger:vt-parser

ANSI and DEC VT escape sequence parser.

Лицензия

Лицензия

Категории

Категории

Сеть
Группа

Группа

net.digger
Идентификатор

Идентификатор

vt-parser
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

net.digger:vt-parser
ANSI and DEC VT escape sequence parser.
Ссылка на сайт

Ссылка на сайт

https://github.com/diggernet/VTParser
Система контроля версий

Система контроля версий

https://github.com/diggernet/VTParser/tree/develop

Скачать vt-parser

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.digger/vt-parser/ -->
<dependency>
    <groupId>net.digger</groupId>
    <artifactId>vt-parser</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.digger/vt-parser/
implementation 'net.digger:vt-parser:1.0.0'
// https://jarcasting.com/artifacts/net.digger/vt-parser/
implementation ("net.digger:vt-parser:1.0.0")
'net.digger:vt-parser:jar:1.0.0'
<dependency org="net.digger" name="vt-parser" rev="1.0.0">
  <artifact name="vt-parser" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.digger', module='vt-parser', version='1.0.0')
)
libraryDependencies += "net.digger" % "vt-parser" % "1.0.0"
[net.digger/vt-parser "1.0.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
net.digger : state-machine jar 1.0.0

Модули Проекта

Данный проект не имеет модулей.

VTParser

VTParser is an ANSI and DEC VT escape sequence parser. It enables implementing an ANSI or VT-xxx emulator (or a subset), without needing to do the hard part of parsing the text for escape sequences and correctly handling the subtle complications found there.

It implements Paul Flo Williams' state machine, and is loosely based on Joshua Haberman's vtparse.

Maven configuration

	<dependency>
		<groupId>net.digger</groupId>
		<artifactId>vt-parser</artifactId>
		<version>1.0.0</version>
	</dependency>

Usage

  1. Implement the VTEmulator interface, which contains handlers for all the possible ANSI/VT actions. Implement only those actions you care about, and ignore the rest.
  2. Pass an instance of your VTEmulator implementation to the VTParser constructor.
  3. Send your text to VTParser.parse().

For example, if all you care about is printing text with color (using the SGR command), you can implement these handlers in VTEmulator:

  • actionPrint(): ch is a printable character, to be printed in the current text color.
  • actionExecute(): ch is a control character (or printable in some character sets).
  • actionCSIDispatch(): If ch equals 'm' and intermediateChars is empty, this is an SGR command, and params contains the list of codes for setting text color.

JScreen contains a VTEmulator implementation in ANSI.java.

Dependencies

License

VTParser is provided under the terms of the GNU LGPLv3.

Версии библиотеки

Версия
1.0.0