Commit Graph

16 Commits

Author SHA1 Message Date
Moulins 03d54262c6 wstr: statically check the size of WString
This adds the 'static_assertions' crate as a dependency of
'ruffle_wstr', but this dependency was already present in the dep tree.
2022-08-16 13:47:00 -07:00
Moulins 8806e9921a wstr: Fix provenance in WString::from_buf_unchecked
Get a pointer with provenance over the whole buffer, instead of a
pointer with provenance only to the initialized part.
2022-08-16 13:47:00 -07:00
Moulins a678a39e85 wstr: implement ToOwned::clone_into for WStr 2022-08-16 13:47:00 -07:00
Moulins 2e255a5bba wstr: Shrink WString to 16 bytes on 64-bits targets 2022-08-16 13:47:00 -07:00
Moulins 2d60e62b8b wstr: introduce explicit WStrMetadata type 2022-08-16 13:47:00 -07:00
EmperorBale ea79f98eb5 wstr: All characters should be decoded before being pushed to the wstring buffer 2022-07-25 10:52:56 -07:00
EmperorBale efa8dbbc40 chore: Rename AvmUtf8Decoder to DecodeAvmUtf8 2022-07-25 10:52:56 -07:00
EmperorBale bc31014f93 chore: Better organization 2022-07-25 10:52:56 -07:00
EmperorBale 67dd53ac9f chore: Clippy 2022-07-25 10:52:56 -07:00
EmperorBale d6604f538c wstr: Implement custom UTF-8 decoding routine 2022-07-25 10:52:56 -07:00
relrelb c0e84e646e wstr: Implement `ToOwned` for `WStr`
Similarly to how `str` implements `ToOwned`, and `From<&str> for String`
forwards to `to_owned()`.

This will allow defining `Cow<WStr>`.
2022-07-06 09:19:12 +03:00
Moulins 3bbbf2f764 wstr: make the crate no_std
This requires removing the Error impl of ParseNumError, because the
Error trait is std-only.
2022-03-26 13:42:57 -07:00
Moulins 1bff5c517a Move back AvmString into ruffle_core::string
This allows removing the gc_arena dependency in ruffle_wstr
2022-03-26 13:42:57 -07:00
Moulins bd576639d5 wstr: refactor traits macro (again) to make it usable outside the crate
And add the AsRef, Borrow, wstr::Pattern to the macro
2022-03-26 13:42:57 -07:00
Moulins 826708a91b wstr: refactor traits macro so that each wstr type uses it separately 2022-03-26 13:42:57 -07:00
Moulins 1911aa9a6b Move core::string into separate ruffle_wstr crate. 2022-03-26 13:42:57 -07:00