-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a
Terminator
type that holds all information about termin…
…ator sequence
- Loading branch information
Showing
20 changed files
with
147 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
shared/src/main/scala/io/kaitai/struct/datatype/Chunk.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.kaitai.struct.datatype | ||
|
||
import io.kaitai.struct.exprlang.Ast | ||
|
||
/** Defines "working" sub-stream, as beginning part of full stream. | ||
* All data after terminator byte is ignored and not available for parsing. | ||
* | ||
* @param value Byte at which stop reading stream | ||
* @param include Specifies if terminator byte should be included in the final value | ||
* @param consume Specify if terminator byte should be "consumed" when reading. | ||
* If `true`: the stream pointer will point to the byte after the terminator byte | ||
* If `false`: the stream pointer will point to the terminator byte itself | ||
* @param mandatory If `true`, terminator must be present in the input stream, otherwise | ||
* reaching end of stream before encountering terminator also possible. | ||
* Corresponds to an `eos-error` key | ||
*/ | ||
sealed case class Terminator( | ||
value: Int, | ||
include: Boolean, | ||
consume: Boolean, | ||
mandatory: Boolean, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.