Lukas Tenbrink
d7f5c13db8
Add `Span` equality (`==` and `!=`) operators.
...
Exchange duplicate equality iteration implementations across `Vector` and `String` with the `Span` version, for a speed boost.
2025-11-15 14:21:54 +07:00
Thaddeus Crews
ae9732139a
Merge pull request #109433 from KoBeWi/hastension
...
Add `has_extension()` method to String
2025-10-31 09:23:30 +07:00
Lukas Tenbrink
dc5e615a1d
Remove `Array` include from `dictionary.h` and `ustring.h`.
2025-10-06 16:21:36 +07:00
Thaddeus Crews
d8df20a2e6
Merge pull request #110932 from Ivorforce/string-buffer-size-comment
...
Add comments to `String::size` to lead people to `length()` and explain the difference.
2025-10-06 09:06:40 +07:00
Lukas Tenbrink
ad600125df
Rewrite `HashMapHasherDefault` based on type traits - it is now possible to declare a default hashing function for any type.
...
Remove cross-project includes from `hashfuncs.h`.
Improve hashing function for `Color` (based on values instead of `String`).
Move `Variant` comparison from `hash_map.h` to `dictionary.cpp` (`VariantComparatorDictionary`), where it's used.
Remove now unnecessary `HashableHasher`.
2025-10-05 01:49:11 +07:00
Lukas Tenbrink
bac9a9be85
Add comments to `String::size` to lead people to `length()` and explain the difference.
...
# Conflicts:
# core/string/ustring.h
2025-10-01 12:08:37 +07:00
Thaddeus Crews
62933b683e
Merge pull request #105928 from Ivorforce/cowdata-reserve-capacity
...
Core: Add `reserve` function to `Array`, `Vector`, and `String`
2025-09-30 11:19:13 +07:00
Thaddeus Crews
f6fc2f4a08
Core: Remove `skip_cr` argument from `String`
2025-09-28 10:07:24 +07:00
Lukas Tenbrink
1bf821c1e1
Store current capacity in `CowData` buffers, and rewrite most of it.
...
Add `reserve` to `CowData`, `Vector` and `Array`.
# Conflicts:
# core/os/memory.h
# core/templates/cowdata.h
2025-09-25 22:00:17 +07:00
Thaddeus Crews
8eeef165d4
Merge pull request #104781 from Ivorforce/string-encode-complete
...
Expose missing `String` encoding conversion functions
2025-09-19 20:54:26 +07:00
Lukas Tenbrink
a916325e6a
Use `Span` for `String.sprintf`, to accelerate `vformat` not needing to allocate an `Array`.
2025-09-18 19:29:04 +07:00
Lukas Tenbrink
d1fd42bf3c
Expose `copy_from_unchecked` as `append_utf32_unchecked` and `String::utf32_unchecked` in `String` for high performance string copies. Expose `append_wstring` and `String::wstring` for platform strings.
2025-09-18 19:26:57 +07:00
kobewi
a33ae0be0e
Add has_extension() method to String
2025-08-12 13:15:16 +07:00
Thaddeus Crews
d4fa7e15ed
Merge pull request #106919 from kitbdev/fix-codeedit-hover-word-lookup
...
Fix CodeEdit hover word lookup
2025-06-18 18:13:43 +07:00
Lukas Tenbrink
b13a0e1834
Rename `String::resize` to `resize_uninitialized`, to better communicate to callers that new characters must be initialized.
2025-06-11 18:13:02 +07:00
Lukas Tenbrink
70672ef008
Optimize `String::get_data`, `length` and `is_empty` by making better assumptions and inlining.
2025-05-30 09:25:21 +07:00
kit
ebf71cd4f3
Fix CodeEdit hover word lookup
2025-05-28 18:35:15 +07:00
Thaddeus Crews
8bcec7afa9
Merge pull request #106730 from Ivorforce/simplify-memnew-arr-placement
...
Simplify `Memory::memnew_arr_placement` to always initialize memory
2025-05-26 11:24:43 +07:00
Yufeng Ying
8773f95e40
Optimize and simplify sarray.
2025-05-23 23:47:57 +07:00
Lukas Tenbrink
4371aa864d
Simplify `Memory::memnew_arr_placement` to always initialize memory, to force callers to make the decision of whether to initialize.
2025-05-22 22:25:12 +07:00
Aaron Franke
15de1d6c35
Use Grisu2 algorithm in String::num_scientific to fix serializing
2025-05-22 09:13:16 +07:00
Thaddeus Crews
090d244b16
Merge pull request #101356 from Ivorforce/inline-utf-creation-functions
...
Inline `String::utf8` and `String::utf16` for their simplicity.
2025-05-07 12:48:32 +07:00
Thaddeus Crews
051712dfb8
Merge pull request #103264 from mhilbrunner/docs-path-join
...
Rename "file" param for str.path_join() to "path"
2025-05-07 12:48:29 +07:00
Thaddeus Crews
579feb387c
Core: Add `[[nodiscard]]` to string-like classes
2025-05-06 12:23:41 +07:00
Lukas Tenbrink
26a6d4062d
Inline `String::utf8` and `String::utf16` for their simplicity.
2025-05-06 17:20:03 +07:00
Lukas Tenbrink
ec32dae1da
Rename `_strlen_clipped` to `strnlen` (and use the system equivalent for `char *` inputs).
...
Add `strnlen` for `char16_t *` and `wchar_t *`.
2025-05-06 15:17:07 +07:00
Thaddeus Crews
999294d77a
Core: Integrate `CharStringT`
2025-04-27 09:58:39 +07:00
Lukas Tenbrink
b711d72e8f
Remove unnecessary `friend class` declarations of `CowData`.
...
Use default implementations for various containers.
2025-04-11 18:26:08 +07:00
Priahoud
bf963e767e
Add Options, Functions and Settings to convert Node-Names and Strings to kebab-case
...
- refactored and renamed String::_camelcase_to_underscore to String:_separate_compound_words
- refactored String::to_snake_case to work with the refactored String::_separate_compound_words
- created char_utils::is_hyphen to catch all hyphen variants in kebab-case conversion
- created String::to_kebab_case using the new String::_separate_compound_words
- created corresponding Documentation in String and StringName
- simplified both switch statements in EditorNode and ProjectDialog
- added new kebab-casing Option for Node Names in ProjectSettings
- added missing camelCase Options to Scene- and Node-Names in ProjectSettings
- simplified Mono RuntimeInterop Functions
- hooked up the ConnectionsDialog
- created additional Unit Tests
2025-04-10 21:22:21 +07:00
A Thousand Ships
889410dcda
Add `String::replace_char(s)` methods for performance and convenience
2025-04-10 13:08:45 +07:00
Thaddeus Crews
7a6c3b309f
Merge pull request #105130 from bruvzg/uri_fix_plus
...
Add uri_file_decode to handle + in file names.
2025-04-09 18:11:56 +07:00
Pāvels Nadtočajevs
b106dfd4f9
Base accessibility API.
2025-04-08 20:14:28 +07:00
Pāvels Nadtočajevs
9abe2e5294
Add `uri_file_decode` to handle `+` in file names.
2025-04-07 23:49:17 +07:00
Thaddeus Crews
780cf03051
Merge pull request #104556 from Ivorforce/string-extend-instead-of-parse
...
Use `append_` instead of `parse_` for `String` methods.
2025-03-29 10:16:33 +07:00
bruvzg
48bfe13e4f
Add methods to decode/encode multibyte encodings.
2025-03-28 17:32:34 +07:00
Lukas Tenbrink
ffa6ef220b
Use `append_` instead of `parse_` for `String` methods.
2025-03-27 17:51:02 +07:00
Thaddeus Crews
f09ee0171a
Style: Begin integrating simple `.clangd` fixes
2025-03-22 13:24:35 +07:00
Rémi Verschelde
2fa721b1bc
Merge pull request #104127 from Ivorforce/360-noclip
...
Remove `String` clipping constructors.
2025-03-19 12:27:10 +07:00
Thaddeus Crews
fdbf6ecc9f
Merge pull request #98408 from rune-scape/stringlikevariantorder-in-place
...
StringLikeVariantOrder: Compare in-place
2025-03-18 14:42:58 +07:00
rune-scape
0c7d78f455
StringLikeVariantOrder: Compare in-place
2025-03-18 11:21:30 +07:00
Yyf2333
b28d6d1fa3
Don't inline certain functions for smaller binary size.
...
Co-authored-by: Thaddeus Crews <repiteo@outlook.com>
2025-03-18 21:40:25 +07:00
Lukas Tenbrink
8c14766597
Add missing `String + char *` function, to avoid unnecessary right side allocation to `String`.
2025-03-17 17:31:35 +07:00
Lukas Tenbrink
a23f630781
Remove `String` clipping constructors.
...
Callers should instead call constructors with explicit encoding names, with known length `Span`.
2025-03-15 12:34:44 +07:00
Lukas Tenbrink
626ff950fb
Deduplicate `string::parse_utf32(char32_t)` in favor of just using the `Span` based function.
2025-03-13 15:11:55 +07:00
Thaddeus Crews
e97bb76142
Merge pull request #100314 from Ivorforce/use-string-chr
...
Optimize `String::chr` to avoid calling `strlen`. Use `String::chr` instead of `String(&chr, 1)` where appropriate.
2025-03-13 08:57:20 +07:00
Thaddeus Crews
74907876d3
Merge pull request #103759 from Ivorforce/zero-constructible
...
Optimize `Array.resize` by using `memset` (through new `is_zero_constructible` type trait)
2025-03-12 10:31:55 +07:00
Lukas Tenbrink
75bc471965
Add `is_zero_constructible` to denote if a type can be semi-trivially constructed with all 0 bytes.
...
Optimize `CowData` and `LocalVector` resize for zero constructible types.
Mark several compatible types as `is_zero_constructible`.
2025-03-12 09:49:24 +07:00
Thaddeus Crews
754e3b3f9a
Merge pull request #103825 from JulianHeuser/region_highlight_crash_fix
...
Fix crash related to #region/#endregion caused by trailing spaces
2025-03-11 19:54:46 +07:00
Julian
659d1b5d0c
Fix crash caused by trailing spaces
2025-03-11 00:06:08 +07:00
Lukas Tenbrink
1818453faa
Make use of `latin1` encoding explicit in `gdextension_interface.cpp`.
2025-03-10 19:33:56 +07:00