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 encoding, string conversion and compression methods to PackedByteArray #994

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Dec 31, 2024

Adds the following methods:

  • Compression
    • compress
    • decompress
    • decompress_dynamic
  • Number encoding and decoding
    • {en,de}code_u8
    • {en,de}code_u16
    • {en,de}code_u32
    • {en,de}code_u64
    • {en,de}code_s8
    • {en,de}code_s16
    • {en,de}code_s32
    • {en,de}code_s64
    • {en,de}code_half
    • {en,de}code_float
    • {en,de}code_double
    • encode_var
    • decode_var, decode_var_allow_nil
    • decode_var_size
    • has_encoded_var
  • String conversions
    • get_string_from_ascii
    • get_string_from_utf8
    • get_string_from_utf16
    • get_string_from_utf32
    • get_string_from_wchar
    • hex_encode

I had to change the API around decode_var() because the raw FFI methods are incredibly hard to use correctly. Check its doc for details.

@Bromeon Bromeon added feature Adds functionality to the library c: core Core components labels Dec 31, 2024
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-994

@Bromeon Bromeon force-pushed the feature/packedbytearray branch 3 times, most recently from 4d668e0 to b434808 Compare December 31, 2024 15:58
@Bromeon Bromeon force-pushed the feature/packedbytearray branch from b434808 to a0d308f Compare December 31, 2024 16:01
@Bromeon Bromeon added this pull request to the merge queue Dec 31, 2024
Merged via the queue into master with commit 6cdbfde Dec 31, 2024
15 checks passed
@Bromeon Bromeon deleted the feature/packedbytearray branch December 31, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: core Core components feature Adds functionality to the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants