gennyble / hext

A Binary File Markup Language
ISC License
23 stars 0 forks source link

String style switching #11

Open gennyble opened 2 years ago

gennyble commented 2 years ago

Recentlyish I've wanted to write a string and have it length-prefixed, but cstrings still exist, yeah? ~string_style length-prefixed How I believe Rust holds strings. Some int size (configurable?) and then the bytes of the string. Although Rust uses char I think, which is distinctly not a byte here so maybe a bad example.

~string_style null-terminated Classic cstring style. The entire string and then one 0x00 to end it

~string_style raw (no-style?) Just the bytes here. This is how it currently works.

gennyble commented 2 years ago

Perhaps it could be ~string_style length-prefixed u64 or whatever the size is. Yell about floats, obviously. (for when we add floats, I mean)