EmperorBale
dde2895f98
wstr: Use `extend_from_slice` instead of manually pushing to output.
2022-07-25 10:52:56 -07:00
EmperorBale
026fcfff62
wstr: Ascii character detection in the UTF-8 decoder should use `<`, not `<=`
2022-07-25 10:52:56 -07:00
EmperorBale
ae5e2be8a3
chore: Simplify code for UTF-8 decoding
2022-07-25 10:52:56 -07:00
EmperorBale
df4e56f9dd
chore: Appease clippy
2022-07-25 10:52:56 -07:00
EmperorBale
577f221db8
chore: Small cleanup
2022-07-25 10:52:56 -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
dda97dbccb
wstr: Fix small logic error when decoding UTF-8
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
19605cff45
chore: Add more comments
2022-07-25 10:52:56 -07:00
EmperorBale
ba2416c126
core: Multibyte codepoints cannot be in ascii range
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
relrelb
f66159a387
wstr: Allow creating `Pattern` from `FnMut`
...
This aligns with Rust's standard `Pattern`:
https://doc.rust-lang.org/std/str/pattern/trait.Pattern.html
Also rename `Predicate::is_match` to `matches` in order to appease
Clippy's `wrong-self-convention` lint, and anyway this is closer to
Rust's `MultiCharEq::matches`.
2022-06-21 08:02:40 +03:00
Mike Welsh
9d5e461278
core: Add WStr::eq_with_case
2022-05-09 17:39:49 -07:00
relrelb
f6153ff7c1
chore: Appease clippy
2022-05-06 10:36:38 -07: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