summaryrefslogtreecommitdiffstats
path: root/core/string/ustring.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Core] Optimize `String::replace` methodsA Thousand Ships2024-11-151-60/+157
| | | | | | | Performs a single allocation, only when any instances are found, and avoids concatenations and other unnecessary conversions. (cherry picked from commit cbaec62b0335bc70c7cf7d55651678591bafafd2)
* Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
|
* Rebrand preambles to RedotSpartan3222024-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e8542b06acca3c1bdeee4b528411771f0819f084) Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Fix split_floats behavior when spaces are used as separatorsHaoyu Qiu2024-09-161-2/+8
| | | | (cherry picked from commit f483c3aafa5f3cfb1ab763ab4eb077aac74e88d6)
* Replace `find` with `contains/has` where applicableA Thousand Ships2024-05-081-1/+1
| | | | | | | * 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
* Add const char * overloads to String classWilson E. Alvarez2024-05-071-8/+426
| | | | Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
* Prefer family name in fonts' names tableHaoyu Qiu2024-04-061-3/+7
|
* [Core] Fix incorrect file sort methodA Thousand Ships2024-03-241-4/+3
|
* Merge pull request #89671 from alesliehughes/string_underrunRémi Verschelde2024-03-241-2/+2
|\ | | | | | | Stop possible underrun when processing a string
| * Stop possible underrun when processing a stringAlistair Leslie-Hughes2024-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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) ....
* | Fix sorting of files/dirs in dialogsA Thousand Ships2024-03-201-39/+88
|/ | | | Sorts leading `_` before other characters except `.`.
* Enforce template syntax `typename` over `class`Thaddeus Crews2024-03-071-1/+1
|
* Fix String::begins_with when both strings are emptyMika Viskari2024-03-051-1/+5
|
* Add option to add built-in strings in the POT generationMichael Alexsander2024-02-281-14/+7
|
* Remove word duplicates in comments and strings, and fix casing and punctuationRobert Yevdokimov2024-02-231-1/+1
|
* Add Unicode support to `String.to_*_case()` methodsDanil Alexeev2024-02-221-5/+5
|
* Add const lvalue ref to core/* container parametersMuller-Castro2024-02-141-1/+1
|
* Remove unnecessary `this->` expressionsA Thousand Ships2024-01-291-14/+14
|
* Merge pull request #84462 from MewPurPur/optimize-humanizesizeRémi Verschelde2024-01-041-16/+31
|\ | | | | | | Optimize `String.humanize_size()`
| * Optimize String.humanize_size()MewPurPur2023-11-051-16/+31
| |
* | Merge pull request #84445 from Rubonnek/add-const-references-clang-tidyRémi Verschelde2024-01-041-2/+2
|\ \ | | | | | | | | | Add const references detected by clang-tidy
| * | Add const references detected by clang-tidyWilson E. Alvarez2023-12-161-2/+2
| | |
* | | Merge pull request #84375 from Rubonnek/use-const-referenceRémi Verschelde2024-01-041-4/+4
|\ \ \ | |/ / |/| | | | | Add const references in `String` class
| * | Add const references in String classWilson E. Alvarez2023-11-021-4/+4
| |/
* | Add 'u' format modifier for unsigned int/hexPedro J. Estébanez2023-12-011-5/+21
| |
* | Add unsigned char cast ifdef.bruvzg2023-11-291-0/+20
| |
* | Allow auto-generated node names in `PopupMenu::add_submenu_item`Yuri Sizov2023-11-091-1/+6
|/
* Do not replace starting digit with underscore when making identifierAlfonso J. Ramos2023-10-041-11/+13
|
* Fix platform-dependent hashing for char* and wchar_t*Jan Haller2023-09-241-6/+14
| | | | | | 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.
* [String] Fix string conversion for -0.0 float values.bruvzg2023-09-051-5/+5
|
* Optimize String.left() and String.right()MewPurPur2023-08-201-2/+6
|
* Merge pull request #78529 from Chaosus/string_reverseRémi Verschelde2023-08-161-0/+17
|\ | | | | | | Add `String.reverse` method
| * Add `String.reverse` methodYuri Roubinski2023-06-211-0/+17
| |
* | [String] Fix Unicode parsing error message encoding and related JSON tests.bruvzg2023-07-281-1/+1
| |
* | Fix erroneous pad_zeros warningMewPurPur2023-07-081-4/+5
| |
* | Merge pull request #74760 from lassade/unicode-err-uses-replacement-charRémi Verschelde2023-06-221-31/+50
|\ \ | |/ |/| | | Don't append non unicode scalar values on the string, instead use the unicode replacement char
| * use the unicode replacement char on errorFelipe Jorge2023-03-121-31/+50
| | | | | | | | | | | | | | | | update tests also fix utf8 and ascii parse functions to use the replacement char created a _replacement_char const inside the string
* | Merge pull request #76735 from AThousandShips/natural_cmpRémi Verschelde2023-05-091-48/+110
|\ \ | | | | | | | | | Add `naturalcasecmp_to` function to `String`
| * | Add `naturalcasecmp_to` function to `String`Ninni Pipping2023-05-071-48/+110
| | | | | | | | | | | | Functions as a complement to `naturalnocasecmp_to`
* | | Merge pull request #75510 from SilicDev/string_eraseClay John2023-05-051-0/+6
|\ \ \ | | | | | | | | Reimplement `String.erase()` as immutable method
| * | | Reimplement String.eraseSilicDev2023-05-041-0/+6
| | | |
* | | | Merge pull request #72288 from MewPurPur/use-string-repeatClay John2023-05-051-24/+17
|\ \ \ \ | |_|/ / |/| | | Use `String.repeat()` to optimize several String methods
| * | | Use String.repeat() in more placesVolTer2023-05-011-24/+17
| | | |
* | | | Fix misuses of error macrosDanil Alexeev2023-04-181-1/+1
| | | |
* | | | Optimize Node::add_child validationJuan Linietsky2023-04-071-6/+73
| |/ / |/| | | | | | | | Adding 10k nodes is almost twice as fast.
* | | add `hex_decode()` to `String`bendn2023-04-051-0/+29
| | |
* | | Add GDScript `to_wchar_buffer` and `get_string_from_wchar` functions.bruvzg2023-03-211-0/+8
| |/ |/|
* | Fix String.split() with empty string and delimeterVolTer2023-02-021-0/+8
| |
* | Handle gltf binaryK. S. Ernest (iFire) Lee2023-01-271-1/+19
|/ | | | | | | | | | | | [ 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.
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | 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".