Thaddeus Crews
7fed5f29ed
Merge pull request #99826 from kiroxas/improveParseUTF8Performance
...
Improve `parse_utf8` performance
2025-03-24 10:00:55 -05:00
kobewi
10f6c01b9c
Remove ABS in favor of Math::abs
2025-03-19 13:52:40 +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
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
Julian
659d1b5d0c
Fix crash caused by trailing spaces
2025-03-11 00:06:08 -04:00
A Thousand Ships
331a43a9d8
Add String::remove_char(s) methods for performance and convenience
2025-03-10 13:19:28 +01:00
Thaddeus Crews
324512e11c
Style: Replace header guards with #pragma once
2025-03-07 17:33:47 -06:00
Lukas Tenbrink
e34f1f504c
Use std::size instead of sizeof(a) / sizeof(a[0]) pattern throughout the codebase.
2025-02-07 14:57:48 +01:00
Pāvels Nadtočajevs
b50d9742c2
Fix is_valid_float, Variant parser, Expression parser, script highlighter, and TextServer not handing capital E in scientific notation.
2025-02-05 18:39:40 +02:00
bruvzg
3be46a69c4
Fix uppercase B and X parsing in the integer literals.
2025-02-05 16:02:06 +02:00
Jan Haller
df66ea74d7
Fix NodePath::slice() incorrect behavior for subname indexing
...
Adjust slice boundaries in `NodePath` logic to correctly handle subnames.
Update test cases to reflect these changes.
2024-12-30 21:22:26 +01:00
Kiro
e4f8a7f8cf
improveParseUTF8Performance
2024-12-16 09:55:11 +01:00
demolke
964e2b3a9e
Fix handling of leading .. in simplify_path
...
Prior to this `..\..\texture.png` was incorrectly simplified to `texture.png`
2024-12-06 07:53:55 +01:00
Dan Nicholson
6f4fadf65d
Expose standardize_locale add_default param publicly
...
Comparing locales can have surprising outcomes since it standardizes
locales with defaults. For example, zh and zh_CN result in an exact
match since the defaults change them both to zh_Hans_CN. Expose the
add_default parameter publicly with a default of false so the fully
standardized locale can be inspected.
2024-11-21 16:50:31 -07:00
Thaddeus Crews
27b394c52a
Merge pull request #98743 from dbnicholson/improve-compare-locales
...
Improve locale comparison
2024-11-12 09:27:54 -06:00
Dan Nicholson
2dd409fd70
Improve locale comparison
...
Since 9456454109 , country specific locales are always preferred over
country-less locales even when the OS locale country doesn't match. For
example, running the Godot editor with locale es_ES will result in the
es_AR locale being chosen even though the es locale would be better.
The change happened because the score of the es_AR locale and the es
locale are the same when comparing to es_ES. Change this by parsing
locale strings into a Locale structure and decreasing the score when
script, country or variant are set in both but not matched. For the
es_ES case, this causes the es_AR score to be decreased since the
countries don't match. On the other hand, the es locale is not decreased
since it doesn't specify a country.
2024-11-12 06:06:50 -07:00
Thaddeus Crews
6c4c61f1b2
Merge pull request #98547 from timothyqiu/loaded-locales-set
...
Fix duplicated entries in `TranslationServer::get_loaded_locales()`
2024-11-11 14:18:40 -06:00
Juan
fe34c45d2a
Allow passing UID to importer
...
This helps, for importers spitting out new resources to the res://
filesystem to actually hash them to generate deterministic UIDs.
This PR also fixes the determinism for translations.
2024-11-11 15:22:42 +01:00
Thaddeus Crews
63838c936c
Merge pull request #98278 from a-johnston/fuzzy-search-rebase
...
Add fuzzy string matching to quick open search
2024-11-10 12:12:56 -06:00
Thaddeus Crews
363c0b5fec
Merge pull request #47502 from KoBeWi/add_0
...
Always add decimal when converting float to string
2024-10-31 20:14:39 -05:00
Adam Johnston
3ac043c508
Add fuzzy string matching to quick open search
...
Co-authored-by: sam <samsface@gmail.com >
2024-10-28 11:24:36 -07:00
Haoyu Qiu
f451997666
Fix duplicated entries in TranslationServer::get_loaded_locales()
2024-10-26 15:10:43 +08:00
kobewi
5c0f2414cd
Always add decimal when printing float
2024-10-23 15:00:21 +02:00
yeojunh
b3b24ded19
Add checks for valid base in String::num_int64, uint64().
...
- Ensure String::num_int64, uint64 returns an empty string for bases less than 2 or greater than 36.
- Added corresponding test cases to verify the behavior.
- Error messages are printed when invalid bases are encountered. These messages are suppressed in the test output.
2024-10-20 00:22:08 -07:00
Pablo Andres Fuente
0b258e69f3
Add unit tests for String::parse_url()
2024-10-01 17:09:22 -03:00
Haoyu Qiu
6516ca6b11
Parse fragment from URL
2024-09-27 19:42:30 +08:00
Haoyu Qiu
a751c05b15
Fix script editor wrongly replaces and quotes non-ASCII letters
2024-09-23 00:05:16 +08:00
Mika Viskari
3153e9afda
Added more unit tests for String insert and join.
2024-08-29 20:05:44 +03:00
Haoyu Qiu
8bf4ecc026
Add String.is_valid_unicode_identifier()
...
- Adds `is_valid_unicode_identifier()`
- Adds `is_valid_ascii_identifier()`
- Deprecates `is_valid_identifier()`
- Renames `validate_identifier()` to `validate_ascii_identifier()`
2024-08-27 11:34:08 +08:00
Rémi Verschelde
49e5fbfbd2
Merge pull request #95184 from jsjtxietian/shader-include-relative
...
Fix `String::simplify_path` handling of relative paths to parent dir (`../`), fixes relative shader includes
2024-08-17 00:46:11 +02:00
Rémi Verschelde
803dfcc3cb
Merge pull request #95613 from timothyqiu/split-empty
...
Fix `split_floats` behavior when spaces are used as separators
2024-08-16 14:36:40 +02:00
Haoyu Qiu
f483c3aafa
Fix split_floats behavior when spaces are used as separators
2024-08-16 17:30:44 +08:00
Haoyu Qiu
7343dc3a5d
Split TranslationServer into its own file
2024-08-15 15:00:47 +08:00
jsjtxietian
6cf9af2817
Fix error when use relative #include in .gdshader / .gdshaderinc file
2024-08-08 11:59:14 +08:00
A Thousand Ships
b4c6cc7d82
[Core] Add case-insensitive String::containsn
2024-05-08 12:48:01 +02:00
Wilson E. Alvarez
d4154dbc55
Add const char * overloads to String class
...
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com >
2024-05-07 10:53:00 -04:00
A Thousand Ships
bb6305d1c4
[Core] Fix incorrect file sort method
2024-03-24 17:54:57 +01:00
A Thousand Ships
2cbf469912
Fix sorting of files/dirs in dialogs
...
Sorts leading `_` before other characters except `.`.
2024-03-20 13:45:47 +01:00
Mika Viskari
3026b566b0
Fix String::begins_with when both strings are empty
2024-03-05 20:46:10 +02:00
Rémi Verschelde
1cc9190c70
Merge pull request #81822 from nlupugla/nodepath-slice
...
Add `NodePath::slice` method
2024-02-29 13:53:34 +01:00
A Thousand Ships
d7a72d72e6
Fix running tests in template builds
2024-02-22 18:05:42 +01:00
Danil Alexeev
c0aa88ae4f
Add Unicode support to String.to_*_case() methods
2024-02-22 13:58:46 +03:00
Robert Yevdokimov
f9826a1dd7
Fix various spelling errors
2024-01-04 09:56:43 -05:00
nlupugla
cd221c1816
Added NodePath::slice method.
2023-12-13 13:30:28 -05:00
Mika Viskari
5e40124d4d
Add more C++ unit tests for String to number conversions
2023-12-02 20:54:48 +02:00
Alfonso J. Ramos
5cd7ca0ccc
Do not replace starting digit with underscore when making identifier
2023-10-04 08:05:04 -05:00
bruvzg
2b3bbde6da
[String] Fix string conversion for -0.0 float values.
2023-09-05 11:32:55 +03:00
Rémi Verschelde
20e24bd2bb
Merge pull request #78529 from Chaosus/string_reverse
...
Add `String.reverse` method
2023-08-16 16:53:40 +02:00
Rémi Verschelde
169a28bd0f
Merge pull request #80362 from Calinou/string-use-unicode-compiletime
...
Use compile-time Unicode string conversion
2023-08-07 14:55:58 +02:00
Hugo Locurcio
e9f723006a
Use compile-time Unicode string conversion
...
Thanks to this syntax introduced in C++11, this reduces the amount of work
that needs to be performed at run-time while making the code more terse.
2023-08-07 10:38:16 +02:00