Thaddeus Crews
7a3d2f6779
Merge pull request #106606 from aaronfranke/pow2_64
...
Add 64-bit versions of core power of 2 functions
2025-06-02 18:51:56 -05:00
Aaron Franke
f6f1df7d73
Add 64-bit versions of core power of 2 functions
2025-06-01 23:11:12 -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 +02:00
kit
ebf71cd4f3
Fix CodeEdit hover word lookup
2025-05-28 18:35:15 -04:00
Thaddeus Crews
b09c70c8db
Merge pull request #106855 from timothyqiu/control-through-stillness
...
Don't update scene tree when calling `Translation::set_locale()`
2025-05-27 09:39:33 -05:00
Haoyu Qiu
9285bb3a51
Don't update scene tree when calling `Translation::set_locale()`
2025-05-27 09:34:58 +08:00
Haoyu Qiu
8d93b6a54c
Add translation preview in editor
2025-05-27 07:59:28 +08: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 -05:00
Thaddeus Crews
81953d3cc2
Merge pull request #106445 from YYF233333/opt_sarray
...
Optimize and simplify `sarray`
2025-05-26 11:24:38 -05:00
Thaddeus Crews
c2fde491b7
Merge pull request #105996 from a-johnston/fuzzy_search_case_fix
...
Only update case sensitive fuzzy searching within `set_query`
2025-05-26 11:24:23 -05:00
Yufeng Ying
8773f95e40
Optimize and simplify sarray.
2025-05-23 23:47:57 +08: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 +02:00
Aaron Franke
15de1d6c35
Use Grisu2 algorithm in String::num_scientific to fix serializing
2025-05-22 09:13:16 -07:00
Adam Johnston
76a65de3ab
Change fuzzy search to only set case sensitive within set_query
2025-05-15 12:00:55 -07:00
Rémi Verschelde
03cae12314
Merge pull request #106295 from timothyqiu/legacy-l10n
...
Remove translation loading logic that was never used
2025-05-13 01:05:31 +02:00
Lukas Tenbrink
e8c3409d40
Remove 4 unintentional uses of zero-width space and zero-width non-joiner.
2025-05-12 22:00:37 +02:00
Haoyu Qiu
bbc6643e4c
Remove translation loading logic that was never used
2025-05-12 19:05:20 +08: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 -05: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 -05:00
Thaddeus Crews
579feb387c
Core: Add `[[nodiscard]]` to string-like classes
2025-05-06 12:23:41 -05:00
Lukas Tenbrink
26a6d4062d
Inline `String::utf8` and `String::utf16` for their simplicity.
2025-05-06 17:20:03 +02:00
Thaddeus Crews
e085acd71c
Merge pull request #104815 from Ivorforce/strnlen
...
Rename `_strlen_clipped` to `strnlen` (and use the system equivalent for `char *` inputs)
2025-05-06 08:38:06 -05: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 +02:00
Thaddeus Crews
5aca298548
Merge pull request #106051 from dalexeev/move-alt-codes-from-char-range
...
Move `alt_code_oem437` and `alt_code_cp1252` to separate header file
2025-05-05 11:24:14 -05:00
Thaddeus Crews
743c1eed49
Merge pull request #106027 from aaronp64/string_format_perf
...
Reduce allocations/copies in `String::format`
2025-05-05 11:24:13 -05:00
Danil Alexeev
413cb795cd
Move `alt_code_oem437` and `alt_code_cp1252` to separate header file
2025-05-03 11:52:49 +03:00
aaronp64
a4ba8c37c9
Reduce allocations/copies in String::format
...
- Updated initial new_string copy to use copy constructor/increase ref count instead of copying to new allocated memory
- Removed Variant copies from Array before assigning to String
- Only convert i to String when needed
2025-05-02 12:32:11 -04:00
Thaddeus Crews
01fc9aee6c
Core: Modernize C headers with C++ equivalents
2025-05-02 08:23:01 -05:00
Thaddeus Crews
baf9d6e150
Merge pull request #105871 from Ivorforce/quick-stringname-fixes
...
Quick `StringName` improvements.
2025-04-30 16:51:52 -05:00
Thaddeus Crews
fb08e94c35
Merge pull request #105930 from a-johnston/fuzzy_search_index_field
...
Add original index field to fuzzy search result
2025-04-30 16:51:51 -05:00
Lukas Tenbrink
91362a61da
Simplify `StringName` to `bool` conversions.
...
Move `mutex` include of `string_name.h` to `string_name.cpp`.
2025-04-30 16:59:34 +02:00
Adam Johnston
e025c9ed11
Add original index field to fuzzy search result
2025-04-29 17:39:59 -07:00
Thaddeus Crews
60aae6d856
Merge pull request #86653 from Mickeon/string-format-error
...
Improve error message for `String.format` when using nested Arrays
2025-04-29 16:05:20 -05:00
Lukas Tenbrink
e57427900f
Use `BinaryMutex` instead of `Mutex` for `StringName`.
2025-04-28 17:13:26 +02:00
Lukas Tenbrink
f064a415b3
Use `PagedAllocator` for `StringName` to accelerate and localize allocations.
2025-04-28 10:38:17 +02:00
Pāvels Nadtočajevs
03048aa94a
Improve edited scene layout direction detection.
2025-04-28 07:57:26 +03:00
Thaddeus Crews
3947cbe3b2
Merge pull request #104386 from Repiteo/core/cpp-math
...
Core: Replace C math headers with C++ equivalents
2025-04-27 19:21:22 -05:00
Thaddeus Crews
ba0ad482ec
Merge pull request #105760 from Ivorforce/string-name-encapsulate
...
Remove unnecessary `StringName` `idx` cache in `_Data` to reduce its size.
2025-04-27 19:21:15 -05:00
Thaddeus Crews
999294d77a
Core: Integrate `CharStringT`
2025-04-27 09:58:39 -05:00
Lukas Tenbrink
3b31636985
Remove unnecessary `StringName` `idx` cache in `_Data` to reduce its size by 4 bytes.
...
Encapsulate `StringName` details in its cpp file.
2025-04-25 19:22:29 +02:00
Thaddeus Crews
931820d33c
Merge pull request #105278 from Ivorforce/reserve-smoke-test
...
Smoke test: Log an error if `reserve()` is called with fewer elements than `size()`
2025-04-23 12:01:28 -05:00
Lukas Tenbrink
7c37188ca1
Smoke test: In collections, log an error if `reserve()` is called with a number smaller than the current size. Don't log an error if it is called with a number smaller than the current capacity.
2025-04-23 16:47:47 +02:00
Lukas Tenbrink
91fe434a86
Always use `String` as `StringName` backing internally.
2025-04-23 14:57:03 +02:00
Thaddeus Crews
ad40939b6f
Core: Replace C math headers with C++ equivalents
...
- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
2025-04-16 15:49:02 -05:00
Thaddeus Crews
86b1fc7205
Merge pull request #104774 from Cykyrios/fix-center-bbcode-ansi-tag
...
Add missing "/" to "center" tag in `__print_line_rich()`
2025-04-15 12:28:44 -05:00
Thaddeus Crews
af252823ac
Merge pull request #101291 from Ivorforce/stringname-to-bool
...
Change `StringName.operator const void *` to `explicit operator bool`.
2025-04-14 19:39:45 -05:00
Thaddeus Crews
e2b6a45e8d
Merge pull request #105247 from bruvzg/fix_nested_bbcode
...
Fix BBCode print with nested `[`.
2025-04-14 19:39:43 -05:00
Lukas Tenbrink
e989d7bd89
Change `StringName.operator const void *` to `explicit operator bool`.
2025-04-11 18:34:01 +02:00
Lukas Tenbrink
b711d72e8f
Remove unnecessary `friend class` declarations of `CowData`.
...
Use default implementations for various containers.
2025-04-11 18:26:08 +02:00
Thaddeus Crews
297650a912
Merge pull request #93466 from bruvzg/alt_oem
...
[TextEdit / LineEdit] Add support for OEM Alt codes input.
2025-04-10 16:53:46 -05: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 +02:00
Pāvels Nadtočajevs
bd3a264011
Fix BBCode print with nested `[`.
2025-04-10 19:53:12 +03:00
A Thousand Ships
889410dcda
Add `String::replace_char(s)` methods for performance and convenience
2025-04-10 13:08:45 +02:00
bruvzg
aa0ade5b49
[TextEdit / LineEdit] Add support for OEM Alt codes input.
2025-04-10 08:52:19 +03: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 -05:00
Pāvels Nadtočajevs
b106dfd4f9
Base accessibility API.
2025-04-08 20:14:28 +03:00
Pāvels Nadtočajevs
9abe2e5294
Add `uri_file_decode` to handle `+` in file names.
2025-04-07 23:49:17 +03:00
Yufeng Ying
4f4031a675
Replace size() == 0 with is_empty().
2025-04-02 19:18:43 +08:00
Thaddeus Crews
92002b1c69
Merge pull request #104218 from zaevi/fix_OptimizedTranslation_hash
...
Fix hash issue with OptimizedTranslation caused by signed char
2025-04-01 19:53:37 -05:00
Kiro
23129a66ed
Replace append_utfx with direct String::utfx
2025-03-30 19:56:38 +02:00
Cyril B.
de5c1f9707
Add missing / for center tag in __print_line_rich
2025-03-29 20:21:31 +01: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 -05:00
bruvzg
48bfe13e4f
Add methods to decode/encode multibyte encodings.
2025-03-28 17:32:34 +02:00
Rémi Verschelde
3fe69cdf74
Merge pull request #104698 from bruvzg/loc_dir
...
Fix editor layout direction change on translation change.
2025-03-28 14:34:52 +01:00
Rémi Verschelde
10799d0b44
Merge pull request #104389 from Ivorforce/color-string-append
...
Optimize `Color::to_html` by allocating less.
2025-03-28 14:32:54 +01:00
Yyf2333
22b5ec17fb
Using iterator pattern instead of List::Element *.
...
Co-authored-by: Adam Scott <ascott.ca@gmail.com>
2025-03-28 13:29:15 +08:00
Lukas Tenbrink
ffa6ef220b
Use `append_` instead of `parse_` for `String` methods.
2025-03-27 17:51:02 +01:00
Pāvels Nadtočajevs
c3921954f2
Fix editor layout direction change on translation change.
2025-03-27 17:35:21 +02:00
Thaddeus Crews
7fed5f29ed
Merge pull request #99826 from kiroxas/improveParseUTF8Performance
...
Improve `parse_utf8` performance
2025-03-24 10:00:55 -05:00
Thaddeus Crews
f09ee0171a
Style: Begin integrating simple `.clangd` fixes
2025-03-22 13:24:35 -05:00
Lukas Tenbrink
143f8e933e
Optimize `Color::to_html` by allocating less.
2025-03-20 13:42:03 +01:00
kobewi
10f6c01b9c
Remove ABS in favor of Math::abs
2025-03-19 13:52:40 +01:00
Rémi Verschelde
64bd03269f
Merge pull request #104286 from Ivorforce/localvector-find
...
Harmonize `String`, `Vector` and `LocalVector` `find` and `rfind`.
2025-03-19 12:27:27 +01:00
Rémi Verschelde
2fa721b1bc
Merge pull request #104127 from Ivorforce/360-noclip
...
Remove `String` clipping constructors.
2025-03-19 12:27:10 +01:00
Thaddeus Crews
fdbf6ecc9f
Merge pull request #98408 from rune-scape/stringlikevariantorder-in-place
...
StringLikeVariantOrder: Compare in-place
2025-03-18 14:42:58 -05: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 +08:00
Lukas Tenbrink
fde71e0382
Harmonize `String`, `Vector` and `LocalVector` `find` and `rfind`.
...
Use `Span::find` for `LocalVector::find`, accepting negative `p_from`.
Return `-1` for invalid `p_from` values in `rfind`.
Accept negative values for `p_from` in `find`, starting from the back.
2025-03-18 12:37:36 +01:00
Thaddeus Crews
bb60b05ca4
Merge pull request #104182 from Ivorforce/small-little-string-function
...
Add missing `String + char *` function, to avoid unnecessary right side allocation to `String`.
2025-03-17 16:03:25 -05:00
Thaddeus Crews
4320800621
Core: Expand `is_zero_constructible` coverage
2025-03-17 11:45:26 -05:00
Lukas Tenbrink
8c14766597
Add missing `String + char *` function, to avoid unnecessary right side allocation to `String`.
2025-03-17 17:31:35 +01:00
Zae
0013d30c92
Fix hash issue with OptimizedTranslation caused by signed char
2025-03-16 15:21:06 +08:00
Lukas Tenbrink
49e860159a
Move `CowData` `find`, `rfind` and `count` to `Span`.
2025-03-16 03:31:11 +01: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 +01: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 +01:00
Thaddeus Crews
c1b7865ae9
Merge pull request #103557 from aaronfranke/godot-version-defines
...
Rename version defines to `GODOT_VERSION_*` to match GDExtension godot-cpp
2025-03-13 08:57:42 -05:00
Thaddeus Crews
22a7079afd
Merge pull request #104047 from YYF233333/dict_iter
...
Add const iteration support to `Dictionary`
2025-03-13 08:57:23 -05: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 -05:00
Aaron Franke
97ee05e9b7
Rename version defines to GODOT_VERSION_* to match GDExtension godot-cpp
2025-03-12 11:11:38 -07:00
Yufeng Ying
bebe037abf
Add ConstIterator to Dictionary.
2025-03-13 01:28:46 +08: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 -05:00
Thaddeus Crews
19057494db
Merge pull request #100238 from Ivorforce/copy-from-unchecked-unchecked
...
Optimize String `copy_from_unchecked` to actually not check the string.
2025-03-12 10:31:54 -05: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 +01: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 -05:00
Lukas Tenbrink
541e721cac
Change String copy_from_unchecked to actually not check the string, leading to performance optimizations across substr, count, and StringBuilder.
2025-03-11 13:47:47 +01:00
Julian
659d1b5d0c
Fix crash caused by trailing spaces
2025-03-11 00:06:08 -04:00
Lukas Tenbrink
1818453faa
Make use of `latin1` encoding explicit in `gdextension_interface.cpp`.
2025-03-10 19:33:56 +01:00
Thaddeus Crews
8d1c1c5867
Merge pull request #92476 from AThousandShips/string_remove_char
...
Add `String::remove_char(s)` methods for performance and convenience
2025-03-10 10:01:04 -05:00
A Thousand Ships
331a43a9d8
Add `String::remove_char(s)` methods for performance and convenience
2025-03-10 13:19:28 +01:00
Lukas Tenbrink
605b62cd29
Add `Span` struct (replacing `StrRange`). Spans represent read-only access to a contiguous array, resembling `std::span`.
2025-03-09 18:19:51 +01:00