Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explanation of dummy objects for relative positioning. #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion user_guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,23 @@ types:
size: len_in_big
----

IMPORTANT: For this technique to work, you must create an actual
object, because unparsed byte arrays do not have an `._io` property
that can be referenced. If your file format contains something like a
heap, and you want to be able to address instances in that stream but
there are no fixed-location elements to parse, you need to create a
dummy object using a technique like the following:

[source,yaml]
----
seq:
- id: heap
size-eos: true
type: dummy
types:
dummy: {}
----

[[process]]
=== Processing: dealing with compressed, obfuscated and encrypted data

Expand Down Expand Up @@ -2513,7 +2530,7 @@ seq:
If we want to provide our own implementation of
`custom_encrypted_object` type, first we need to compile our .ksy file
with `--opaque-types=true` option. This will avoid the error, and
compiler will consider all unknown types to be "opaque", i.e. it will treat
compiler will consider all unknown types to be "opaque", i.e. it will treat
them as existing in some external space.

Alternatively, instead of specifying command line argument
Expand Down