Commit Graph

386 Commits (fe84b84b51df1ff6db658f521d1040aa563cedd0)

Author SHA1 Message Date
Stuart Carnie 67eb6bed2b
use operator += (char32_t)
This prevents an allocation of a new string for every character.

Additionally, use some static constants for padding and sign characters
2024-07-25 09:17:58 +07:00
Gergely Kis 723878bbab StringName: Use inline static field definitions
Before this change StringName used regular static field
definitions for its mutex, _table, configured and debug_stringname
fields.

Since in the general case the ordering of the static variable and field
initialization and destruction is undefined, it was possible that
the destruction of StringName's static fields happened prior to
the destruction of statically allocated StringName instances.

By changing the static field definitions to inline in string_name.h,
the C++17 standard guarantees the correct initialization and destruction
ordering.
2024-07-24 02:40:36 +07:00
Rémi Verschelde f11e8d033d
Remove editor pseudolocalization debug feature
We've seen multiple users enable it by mistake and get utterly confused,
reporting as a bug that the interface text is garbled.

On the other hand we haven't really seen much use of the feature by editor
UI developers, so we can likely simply remove it.

If there's a need eventually, we can re-add it as a command line option
(which is also better than an editor setting as one would typically want
to toggle it during development).
2024-06-24 17:08:26 +07:00
bruvzg dd883bebd4
Improve PR plural translation rules handling. 2024-06-18 19:04:00 +07:00
Silc Lizard (Tokage) Renew 12571a1e95 Match the coding style for concatenating String 2024-06-09 18:35:23 +07:00
Rémi Verschelde a9a1d0a162
Merge pull request #91619 from AThousandShips/find_improve
Replace `find` with `contains/has` where applicable
2024-05-08 14:35:44 +07:00
A Thousand Ships b4c6cc7d82
[Core] Add case-insensitive `String::containsn` 2024-05-08 12:48:01 +07:00
A Thousand Ships a0dbdcc3ab
Replace `find` with `contains/has` where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +07: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 +07:00
Rémi Verschelde 25fe3d4b46
Merge pull request #81639 from MJacred/is_letter
Add `is_valid_letter()` to `TextServer`
2024-05-03 01:21:34 +07:00
MJacred 717513a62d Add is_valid_letter() to TextServer 2024-05-02 21:32:20 +07:00
Aaron Franke b1f5e9fe3a
Rename internal is_ascii_char to is_ascii_alphabet_char 2024-04-20 02:36:41 +07:00
Haoyu Qiu 9bcda8f94c Prefer family name in fonts' names table 2024-04-06 16:08:59 +07:00
Haoyu Qiu 479b7afa8e Add context support for editor property name i18n 2024-03-31 18:40:14 +07:00
A Thousand Ships bb6305d1c4
[Core] Fix incorrect file sort method 2024-03-24 17:54:57 +07:00
Rémi Verschelde 8f9136963d
Merge pull request #89671 from alesliehughes/string_underrun
Stop possible underrun when processing a string
2024-03-24 01:21:12 +07:00
A Thousand Ships 2cbf469912
Fix sorting of files/dirs in dialogs
Sorts leading `_` before other characters except `.`.
2024-03-20 13:45:47 +07:00
Alistair Leslie-Hughes 87fe71f52f Stop possible underrun when processing a string
Calling String::utf8("Unicode String", -1) assumes that the string will be NULL terminated.
However, the length parameter is always used to find the end of the string.  So there is the
chance the character before th start of the string is read.

Making the pointer NULL in the case where it's out of range, still allows the following
to work as expected
while (ptrtmp != ptrtmp_limit && *ptrtmp)
....
2024-03-19 20:17:11 +07:00
Thaddeus Crews 9903e6779b
Enforce template syntax `typename` over `class` 2024-03-07 22:39:09 +07:00
Mika Viskari 3026b566b0 Fix String::begins_with when both strings are empty 2024-03-05 20:46:10 +07:00
Rémi Verschelde 0a089e284b
Merge pull request #87191 from Mickeon/autocompletion-TranslationServer
Add autocompletion for TranslationServer
2024-03-01 14:56:18 +07:00
Micky ffd498c57d Add autocompletion for TranslationServer 2024-02-29 20:43:19 +07:00
Rémi Verschelde 846428e0c6
Merge pull request #86222 from YeldhamDev/give_me_those_strings_baby
Add option to add built-in strings in the POT generation
2024-02-29 13:53:38 +07:00
Rémi Verschelde 1cc9190c70
Merge pull request #81822 from nlupugla/nodepath-slice
Add `NodePath::slice` method
2024-02-29 13:53:34 +07:00
Michael Alexsander d70c45b5c8
Add option to add built-in strings in the POT generation 2024-02-28 11:34:26 +07:00
Robert Yevdokimov 13e82094ee Remove word duplicates in comments and strings, and fix casing and punctuation 2024-02-23 17:28:28 +07:00
Rémi Verschelde 3ce9ae71fc
Merge pull request #84906 from /fix-some-defvals 2024-02-23 11:29:22 +07:00
Raul Santos 5ba92e5a57
Fix some DEFVALs to use the right type
- Use `StringName()` in DEFVAL for StringNames.
- Use `Variant()` in DEFVAL for Variants.
2024-02-23 01:50:18 +07:00
Danil Alexeev c0aa88ae4f
Add Unicode support to `String.to_*_case()` methods 2024-02-22 13:58:46 +07:00
Rémi Verschelde 0fb7e3fc57
Merge pull request #88339 from Rubonnek/remove-hashunion
Remove `_HashUnion` from `StringName`
2024-02-15 15:45:19 +07:00
Wilson E. Alvarez d2003d2025
Remove _HashUnion from StringName 2024-02-14 15:38:57 +07:00
Muller-Castro a8bc9f3e78 Add const lvalue ref to core/* container parameters 2024-02-14 11:20:36 +07:00
Bartłomiej T. Listwon 5ee4b49e42 Link xid_start and xid_continue externally to prevent data duplication in binary 2024-02-11 12:54:53 +07:00
A Thousand Ships 15369fdb1d
Remove unnecessary `this->` expressions 2024-01-29 09:59:18 +07:00
bruvzg e7bdb60e56
[Pseudolocalization] Prevent out of bounds reads. 2024-01-05 14:10:26 +07:00
Rémi Verschelde 5fd5176a79
Merge pull request #84462 from MewPurPur/optimize-humanizesize
Optimize `String.humanize_size()`
2024-01-04 14:25:40 +07:00
Rémi Verschelde 6c390b620d
Merge pull request #84445 from Rubonnek/add-const-references-clang-tidy
Add const references detected by clang-tidy
2024-01-04 14:25:33 +07:00
Rémi Verschelde b66d16fcc9
Merge pull request #84375 from Rubonnek/use-const-reference
Add const references in `String` class
2024-01-04 14:25:27 +07:00
Wilson E. Alvarez a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 +07:00
nlupugla cd221c1816 Added NodePath::slice method. 2023-12-13 13:30:28 +07:00
Rémi Verschelde 41365c6c8b
Merge pull request #70315 from RandomShaper/d3d12_mesa
Direct3D 12 Rendering Driver (Mesa NIR approach)
2023-12-12 21:58:57 +07:00
bruvzg 829349d2ca
Do not reload resources and send notification if locale is not changed. 2023-12-05 16:17:22 +07:00
Pedro J. Estébanez 208c1020f5 Add 'u' format modifier for unsigned int/hex 2023-12-01 16:42:26 +07:00
bruvzg ec052cd38a
Add unsigned char cast ifdef. 2023-11-29 11:59:18 +07:00
bruvzg 8b2260544a
Fix remapped font reloading on locale change. 2023-11-13 21:25:41 +07:00
Yuri Sizov edcad2ea88 Allow auto-generated node names in `PopupMenu::add_submenu_item` 2023-11-09 17:12:41 +07:00
bruvzg f3d4f5a77e
[X11] Add fallback from desktop GL to GLES, suppress PRIME detector error spam. 2023-11-06 12:40:44 +07:00
MewPurPur 931928feb9 Optimize String.humanize_size() 2023-11-05 02:42:54 +07:00
Wilson E. Alvarez dbc49d2a68
Add const references in String class 2023-11-02 13:49:39 +07:00
Yuri Sizov 4952d37f4b Fix StringName leaks in VariantParser 2023-10-19 17:13:15 +07:00
Alfonso J. Ramos 5cd7ca0ccc Do not replace starting digit with underscore when making identifier 2023-10-04 08:05:04 +07:00
Jan Haller 43be9fa0c8 Fix platform-dependent hashing for char* and wchar_t*
Since char/wchar_t can be either signed or unsigned, its conversion to uint32_t leads to different values depending on platform.
In particular, the same string represented as char* (Latin-1; StringName direct construction) or uint32_t (UTF-8; constructed
via String) previously resulted in different hashes.
2023-09-24 20:57:57 +07:00
A Thousand Ships 893f889d74 [Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-09-11 19:45:49 +07:00
Yuri Sizov d8ff69d53c Extract ScriptInstance to simplify includes
This allows to include script_instance.h directly in the
generated gdvirtual.gen.inc, and remove excessive includes
from the codebase.

This should also allow Resource to use GDVIRTUAL macros,
which wasn't possible previously due to a circular dependency.
2023-09-06 22:54:38 +07:00
bruvzg 2b3bbde6da
[String] Fix string conversion for -0.0 float values. 2023-09-05 11:32:55 +07:00
MewPurPur c9287e5224 Optimize String.left() and String.right() 2023-08-20 20:01:06 +07:00
Rémi Verschelde 20e24bd2bb
Merge pull request #78529 from Chaosus/string_reverse
Add `String.reverse` method
2023-08-16 16:53:40 +07:00
Rémi Verschelde 835957b1fc
Merge pull request #79980 from bruvzg/fix_test_str_errs
[String] Fix Unicode parsing error message encoding and related JSON tests.
2023-08-09 15:20:16 +07:00
Yuri Sizov 8654ba130b Merge pull request #79654 from timothyqiu/han
Fix script name of Hant and Hans
2023-08-01 17:25:21 +07:00
bruvzg 84a6f0d232 [String] Fix Unicode parsing error message encoding and related JSON tests. 2023-07-28 12:27:01 +07:00
Yuri Sizov 7c204874eb Merge pull request #78747 from RandomShaper/fix_trans_threading
Support loading of translations on threads
2023-07-26 18:39:27 +07:00
Haoyu Qiu 52cdba6def Fix script name of Hant and Hans 2023-07-20 15:01:39 +07:00
Yuri Sizov f0c24f3145 Merge pull request #79017 from bruvzg/esc_fix
[Terminal Output] Reset text properties after `print_rich`.
2023-07-14 18:49:26 +07:00
MewPurPur cc5500f7de Fix erroneous pad_zeros warning 2023-07-08 16:16:01 +07:00
bruvzg 0e8cb304a5 [Terminal Output] Reset text properties after `print_rich`. 2023-07-04 14:09:28 +07:00
Pedro J. Estébanez 5301bbb3a5 Support loading of translations on threads 2023-06-29 16:48:55 +07:00
Rémi Verschelde 100082b3ac
Merge pull request #74760 from lassade/unicode-err-uses-replacement-char
Don't append non unicode scalar values on the string, instead use the unicode replacement char
2023-06-22 18:30:04 +07:00
Yuri Roubinski 230385b587 Add `String.reverse` method 2023-06-21 20:40:48 +07:00
Ninni Pipping d2ddd8b228 Fix `StringName` comparison 2023-05-18 13:25:40 +07:00
Rémi Verschelde 5ade250c7d
Merge pull request #76735 from AThousandShips/natural_cmp
Add `naturalcasecmp_to` function to `String`
2023-05-09 17:44:37 +07:00
Rémi Verschelde 491a437df5
Merge pull request #76540 from reduz/redo-remote-filesystem
Redo how the remote filesystem works
2023-05-08 13:52:51 +07:00
Juan Linietsky 273a6eeb66 Redo how the remote filesystem works
Instead of reading files over the network, the new version uses a local file cache and only updates files when it changes.

The original remote filesystem was created 14 years ago, when ethernet was faster than hard drives or even flash. Also, mobile devices have a very small amount of storage.
Nowadays, this is no longer the case so the approach is changed to using a persistent cache in the target device.

Co-authored-by: m4gr3d
2023-05-08 11:57:54 +07:00
Ninni Pipping 46a7018e3c Add `naturalcasecmp_to` function to `String`
Functions as a complement to `naturalnocasecmp_to`
2023-05-07 10:17:53 +07:00
Clay John 7a13cf9aeb
Merge pull request #75510 from SilicDev/string_erase
Reimplement `String.erase()` as immutable method
2023-05-05 10:03:49 +07:00
Clay John 610877e326
Merge pull request #72288 from MewPurPur/use-string-repeat
Use `String.repeat()` to optimize several String methods
2023-05-05 09:56:48 +07:00
SilicDev 6fa4f71ca6 Reimplement String.erase 2023-05-04 00:52:35 +07:00
VolTer 6b84e258d2 Use String.repeat() in more places 2023-05-01 02:27:46 +07:00
Danil Alexeev 36bedd341a
Fix misuses of error macros 2023-04-18 10:20:48 +07:00
Juan Linietsky 8950943356 Optimize Object::get_class_name
* Run the static function once per class instead of one per instance.
* Saves some memory in Object derived classes.
2023-04-08 19:25:50 +07:00
Juan Linietsky 223ce4fcb9 Optimize Node::add_child validation
Adding 10k nodes is almost twice as fast.
2023-04-07 13:18:47 +07:00
bendn ca0feabbb0
add `hex_decode()` to `String` 2023-04-05 19:44:00 +07:00
bruvzg d72b563250
Add GDScript `to_wchar_buffer` and `get_string_from_wchar` functions. 2023-03-21 15:39:54 +07:00
Felipe Jorge 999f3e2c13 use the unicode replacement char on error
update tests

also fix utf8 and ascii parse functions to use the replacement char

created a _replacement_char const inside the string
2023-03-12 11:46:56 +07:00
bruvzg 82d7923c65
Improve layout direction/locale automatic selection. 2023-02-22 08:37:14 +07:00
Haoyu Qiu 52b4014362 Don't warn when using TTRN() in a language without plurals 2023-02-11 13:21:57 +07:00
Rémi Verschelde ab4a7b2b77
Merge pull request #72547 from MewPurPur/string-split-fix
Fix String.split() with empty string and delimeter
2023-02-09 16:12:57 +07:00
Haoyu Qiu 5d7e003b29
Prepare for moving editor and classref translations to godot-editor-l10n repo
- Separate editor interface and property translations.
- Add property translation in TranslationServer.
- The split and merge of the POT/PO/Makefiles and extract scripts is done
  directly in godot-editor-l10n, the files will be removed in the next commit.
- Remove the hardcoded "to_include" lists from the SCsub, we'll only commit the
  files which are ready to inclue.
2023-02-07 14:20:40 +07:00
Lyuma 82c52eab6c StringName: fix returning dangling data from char constructor.
Fixes a copy paste mistake in the `StringName(const char *,bool)` constructor,
to match the same form as the other two constrcutors.
This fixes a case where this constructor can return a dangling pointer and cause use-after-free.
2023-02-06 07:16:55 +07:00
VolTer 57e39d0ce9 Fix String.split() with empty string and delimeter 2023-02-02 01:34:11 +07:00
Aaron Franke 0fcdf48f83
Remove unused `has_slashes` from NodePath 2023-02-01 11:32:39 +07:00
K. S. Ernest (iFire) Lee 39922d7167 Handle gltf binary
[ Ignore and Warn | Extract Textures (default) | Optimize Loading Embedded as Basisu ]

Enable compressed mip maps from Basis Universal for faster compressions.

Increase the quality of Basis to avoid corruption.

To keep compatibility use the first mip of the previous internal Godot format.

Because texture names may have invalid filename characters, adds String::validate_filename to sanitize filenames for import pipeline use.
2023-01-27 02:02:02 +07:00
Rémi Verschelde 163f6f5fe8
Merge pull request #68429 from KoBeWi/PropertySettings
Add PropertyInfo overload for GLOBAL_DEF
2023-01-06 22:59:29 +07:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +07:00
Yuri Rubinsky 522d4243bf Add missing != operator to `StringName` 2022-12-20 17:25:54 +07:00
Haoyu Qiu 207e52c161 Fix String::word_wrap() for long words
- Changes `TextServer.string_get_word_breaks()`
  - Returns pairs of boundary start and end offsets
  - Accepts `chars_per_line` to return line breaks
- Removes `String::word_wrap()`

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-12-16 13:18:57 +07:00
kobewi 7c6b659bd7 Add PropertyInfo overload for GLOBAL_DEF 2022-12-11 21:36:48 +07:00
Bastiaan Olij a479f5af22 Improve logic for detecting and tracking extensions 2022-11-24 21:48:16 +07:00
Micky e791f4fce2 Double precision of `String.split_floats` 2022-11-20 12:29:50 +07:00
Rémi Verschelde 1959284769
Merge pull request #68229 from Mickeon/c-escape-hell
Remove "?" from String.c_escape()
2022-11-14 23:24:35 +07:00
Markus Sauermann 3b14f0334c Remove redundant Variant-types initializations 2022-11-14 19:35:19 +07:00
Rémi Verschelde 5b3a03bf5c
Merge pull request #68448 from bruvzg/font_imp_tr
[Font] Add an import option to pre-render all glyphs required for the translation.
2022-11-14 11:12:01 +07:00
bruvzg 35528b800c
[Font] Add an import option to pre-render all glyphs required for the translation. 2022-11-10 10:43:15 +07:00
gnumaru 75e617c05d fix a buffer overflow due to a misbehaving vcrt snprintf call on String::num, at core/string/ustring.cpp 2022-11-09 10:25:52 +07:00
kobewi 8a47a12207 Add support for empty delimiter in String.split 2022-11-04 15:09:12 +07:00
Micky 521d8a5d24 Remove "?" from String.c_escape() 2022-11-03 19:52:21 +07:00
Rémi Verschelde 0e9878b12a
Merge pull request #67931 from bruvzg/locale_no_def
Do not auto add default script and country codes to the locale.
2022-10-31 14:30:18 +07:00
Rémi Verschelde 5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +07:00
bruvzg ec3c4fcba9
Do not auto add default script and country codes to the locale. 2022-10-27 09:31:05 +07:00
Gilles Roudière 56fa8f1d58 Fix localize_path with custom protocol identifiers 2022-10-20 14:12:25 +07:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +07:00
Aaron Franke c60ac64e8f
Fix big negative numbers printing incorrect decimals in num_real 2022-10-15 17:57:54 +07:00
Gilles Roudière bf1a40c168 Make String.simplify_path keep the protocol identifier for urls 2022-10-13 12:23:49 +07:00
Rémi Verschelde 58eff50bf1 Merge pull request #64268 from timothyqiu/is-finite
Add `is_finite` method for checking built-in types
2022-10-11 09:25:46 +07:00
kobewi 785e5880b3 Fix simplify_path() breaking uid:// 2022-10-09 14:22:13 +07:00
Haoyu Qiu 5da515773d Add `is_finite` method for checking built-in types 2022-10-08 13:25:08 +07:00
bruvzg 0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +07:00
Rémi Verschelde cf6978f286 Merge pull request #64833 from MarcusElg/naninfprinting
Improve string formatting (%f and %v) for inf and nan
2022-10-03 09:23:12 +07:00
Rémi Verschelde 0e53dd642c Fix MSVC warning C4706: assignment within conditional expression
Part of #66537.
2022-09-28 16:05:07 +07:00
Rémi Verschelde 49fcf4ffad Style: Cleanup header guards for consistency
Fix file names for {Static,Lightmap}RaycasterEmbree.
2022-09-26 13:51:17 +07:00
bruvzg ec8084d87f
HarfBuzz: Update to version 5.2.0, add new Unicode 15 blocks and scripts. 2022-09-17 23:19:11 +07:00
Rémi Verschelde 10bd79cc6a Merge pull request #64714 from Chaosus/string_remove_erase 2022-09-01 22:57:22 +07:00
Danil Alexeev d4555ef5fb
Add `String.to_{camel,pascal,snake}_case` methods 2022-08-30 12:36:24 +07:00
Aaron Franke 10a56981dc
Rename String `plus_file` to `path_join` 2022-08-29 19:38:13 +07:00
Marcus Elg b21460981d Improve string formatting for %f and %v for inf and nan 2022-08-25 07:41:21 +07:00
kobewi f7f4873ed0 Replace Array return types with TypedArray 3 2022-08-24 12:53:36 +07:00
Rémi Verschelde 08d8f884cd
Merge pull request #63728 from MarcusElg/%v
Add %v for formatting vectors
2022-08-24 00:42:47 +07:00
Marcus Elg dbc165715b Add %v for formatting vectors 2022-08-23 17:26:06 +07:00
VolTer dae64e5361 Improved performance of String repeat method 2022-08-22 22:47:10 +07:00
Yuri Rubinsky 772b0d2818 Remove `String::erase` method declaration 2022-08-22 10:30:08 +07:00
kleonc 1324ca5eb0 Fix undefined behavior in `String::operator+=(const String &)` 2022-08-18 14:57:24 +07:00
Yuri Sizov 1362bc22bd Add tests for empty/unnamed arguments to ClassDB, Variant, GDScript 2022-08-08 16:36:01 +07:00
Rémi Verschelde 33258d850c
Merge pull request #61315 from lawnjelly/variant_bucket_pools
Variant memory pools
2022-08-02 15:54:18 +07:00
bruvzg 5aa48b6ae5
[TextServer] Implement ICU/UAX 31 based `is_valid_identifier` function. 2022-08-02 08:30:20 +07:00
Rémi Verschelde 1418f97c70 File: Re-add support to skip CR (`\r`) in `File::get_as_text`
This was removed in #63481, and we confirmed that it's better like this,
but we add back the possibility to strip CR as an option, to optionally
restore the previous behavior.

For performance this is done directly in `String::parse_utf8`.

Also fixes Android `FileAccess::get_line()` as this one _should_ strip CR.

Supersedes #63717.
2022-08-01 00:40:35 +07:00
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +07:00
bruvzg 0c5431644d
Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose. 2022-07-07 11:07:18 +07:00
lawnjelly b221eab426 Variant memory pools
Memory pools via PagedAllocator for Transform2D, Transform3D, Basis and AABB.
2022-07-04 12:01:46 +07:00
Silc Renew dc43cfc830 implement bone renamer in importer 2022-07-01 03:55:28 +07:00
Voylin c6291bcd8a Adding print_rich for printing with BBCode 2022-06-29 00:41:29 +07:00
Haoyu Qiu 6f38c21253 Fix parameter name for String.left and String.right 2022-06-12 16:34:44 +07:00
Haoyu Qiu 83990c2161 Fix `String.uri_encode` on Windows 2022-06-03 13:58:57 +07:00
reduz 45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +07:00
Hugo Locurcio 7b5bf3af19
Tweak 64-bit integer overflow message to mention that it's a signed type 2022-05-20 14:12:09 +07:00
Aaron Record 900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +07:00
Haoyu Qiu fc3b845c07 Add dedicated macros for property name extraction
* Replace case-by-case extraction with PNAME & GNAME
* Fix group handling when group hint begins with property name
* Exclude properties that are PROPERTY_USAGE_NO_EDITOR
* Extract missing ADD_ARRAY*, ADD_SUBGROUP* macros
2022-05-19 14:08:47 +07:00
Haoyu Qiu 3094e739f5 Create onready variables when dropping nodes and holding Ctrl 2022-05-17 11:51:22 +07:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +07:00
Hugo Locurcio a581908ea0
Add documentation comments for internationalization C++ macros 2022-05-12 22:50:28 +07:00
reduz 8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +07:00
Rémi Verschelde c273ddc3ee Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +07:00