summaryrefslogtreecommitdiffstats
path: root/core/string/ustring.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #57116 from bruvzg/win_net_shareRémi Verschelde2022-01-281-3/+27
|\
| * [Windows] Add support for handling network share paths.bruvzg2022-01-241-3/+27
| |
* | Rename String::is_subsequence_ofi to String::is_subsequence_ofnWilson E. Alvarez2022-01-261-1/+1
|/
* Rename or refactor macros to avoid leading underscoresOmar Polo2022-01-201-17/+17
| | | | | These are not used consistently and some can conflict with system-specific defines. While here, also delete some unused macros.
* Replace String::num_real code with a wrapper around String::numAaron Franke2022-01-151-102/+11
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Make `--doctool` locale awareHaoyu Qiu2021-12-161-0/+21
| | | | | | | | | | | | | | | | * Adds `indent(str)` to `String`: * Indent the (multiline) string with the given indentation. * This method is added in order to keep the translated XML correctly indented. * Moves the loading of tool/doc translation into `editor/editor_translation.{h,cpp}`. * This will be used from both `EditorSettings` and the doc tool from `main`. * Makes use of doc translation when generating XML class references, and setup the translation locale based on `-l LOCALE` CLI parameter. The XML class reference won't be translated if `-l LOCALE` parameter is not given, or when it's `-l en`.
* Replace String comparisons with "", String() to is_empty()Nathan Franke2021-12-091-3/+3
| | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* Don't return reference on copy assignment operatorsRémi Verschelde2021-11-301-4/+2
| | | | | | | | | | | | | We prefer to prevent using chained assignment (`T a = b = c = T();`) as this can lead to confusing code and subtle bugs. According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++ allows any arbitrary return type, so this is standard compliant. This could be re-assessed if/when we have an actual need for a behavior more akin to that of the C++ STL, for now this PR simply changes a handful of cases which were inconsistent with the rest of the codebase (`void` return type was already the most common case prior to this commit).
* Rename `remove()` to `remove_at()` when removing by indexLightning_A2021-11-231-4/+4
|
* Allow dehardcoding documentation branch and URL in docs linksRémi Verschelde2021-11-151-5/+11
| | | | | | | | | | | | | | This makes it possible to change the branch of the documentation that URLs are pointing to without having to modify all class reference files. In the XML class reference, the `$DOCS_URL` placeholder should be used, and will be replaced automatically in the editor and when generating the RST class reference. The documentation branch string is set in `version.py`. Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
* String: Remove `erase` method, bindings can't mutate StringRémi Verschelde2021-11-111-4/+0
|
* Add missing characters for property name quotingHaoyu Qiu2021-11-111-1/+1
|
* clang-format: Various fixes to comments alignment from `clang-format` 13Rémi Verschelde2021-10-281-53/+61
| | | | All reviewed manually and occasionally rewritten to avoid bad auto formatting.
* Merge pull request #54081 from Rubonnek/add_bin_messages_masterRémi Verschelde2021-10-221-1/+1
|\
| * Accept capital B in String::bin_to_int prefixWilson E. Alvarez2021-10-211-1/+1
| |
* | Add error messages to String::hex_to_int, and accept capital X in prefixWilson E. Alvarez2021-10-211-2/+2
|/
* Fix String::num_real and String test cases when compiling with doublesAaron Franke2021-09-151-9/+16
|
* Merge pull request #52049 from theraot/masterRémi Verschelde2021-09-131-11/+27
|\
| * Fix get_base_dir windows top level directory logicTheraot2021-08-241-11/+27
| | | | | | This is a fix for https://github.com/godotengine/godot/issues/52048
* | Remove `#ifdefs` for handling compilation with Visual Studio < 2015Hugo Locurcio2021-08-311-3/+3
| | | | | | | | Godot 3.3 and later require Visual Studio 2017 to be compiled.
* | Rename String::is_rel_path to String::is_relative_pathWilson E. Alvarez2021-08-291-1/+1
|/
* String: Remove old NO_USE_STDLIB code pathRémi Verschelde2021-08-181-91/+1
| | | | | We're using the standard library in many core classes by now so this code path no longer makes sense.
* String: Fix default decimals truncation in num and num_realRémi Verschelde2021-08-181-7/+20
| | | | | | | | Fixes undefined behavior, and fixes the logic for negative powers of ten. Fixes #51764. Adds tests to validate the changes and prevent regressions. Adds docs for `String.num`.
* Convert ustring macros to inline functions and use them wherever possible.Anilforextra2021-08-131-41/+54
| | | | | | Add new inline functions to check if a character is lowercase or uppercase. Remove unused upper case macro.
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-1/+1
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-5/+2
|
* Merge pull request #49291 from NoFr1ends/fix-49262Rémi Verschelde2021-07-131-19/+0
|\ | | | | String::format leave passed values untouched
| * String::format leave passed values untouchedJonas Bernemann2021-06-031-19/+0
| | | | | | | | | | If the passed value or key contains double quotation marks it will no longer get removed.
* | Rename `is_valid_integer()` to `is_valid_int()`Lightning_A2021-06-161-3/+3
| | | | | | | | Method from `String`
* | Merge pull request #49505 from underdoeg/patch-2Rémi Verschelde2021-06-161-1/+1
|\ \ | | | | | | fix url parsing with port numbers
| * | fix url parsing with port numbersPhilip Whitfield2021-06-111-1/+1
| |/ | | | | | | String.get_slice_count is always at least 1 or 2 for bases with a port number. Before this change the following URL would return ERR_INVALID_PARAMETER ```ws://127.0.0.1:8000/test```
* | Reformat structure string operatorsAaron Franke2021-06-111-2/+4
| | | | | | | | | | | | The order of numbers is not changed except for Transform2D. All logic is done inside of their structures (and not in Variant). For the number of decimals printed, they now use String::num_real which works best with real_t, except for Color which is fixed at 4 decimals (this is a reliable number of float digits when converting from 16-bpc so it seems like a good choice)
* | Merge pull request #49279 from Calinou/rename-string-is-abs-path-methodRémi Verschelde2021-06-111-2/+2
|\ \ | | | | | | Rename `String.is_abs_path()` to `String.is_absolute_path()`
| * | Rename `String.is_abs_path()` to `String.is_absolute_path()`Hugo Locurcio2021-06-031-2/+2
| |/ | | | | | | This is more consistent with `NodePath.is_absolute()`.
* / Increase String::num default decimal precisionHeikki Simojoki2021-05-291-9/+22
|/ | | | | | | | | | | | | | | | | | Fixes #34541 Renamed MAX_DIGITS to MAX_DECIMALS, since it only changes the amount of digits after the decimal point. Increased MAX_DECIMALS to 32, and made String::num use MAX_DECIMALS consistently. If -1 is passed as decimal precision to String::num, it now gets changed to the correct precision based on the number's magnitude, instead of using printf default(which is 6) String::num_real also calculates the correct precision now. Also made the types used in floating-point math more consistent in a few places.
* Fix usage of String.left()kobewi2021-05-211-1/+1
|
* Change behavior of String.rightTomasz Chabora2021-05-201-8/+16
|
* Merge pull request #48205 from Faless/net/4.x_url_parsingFabio Alessandrelli2021-05-031-0/+65
|\ | | | | [Net] Implement String::parse_url for parsing URLs.
| * [Net] Implement String::parse_url for parsing URLs.Fabio Alessandrelli2021-04-261-0/+65
| | | | | | | | | | | | | | | | Splits the URL into (scheme, host, port, path). Supports both literal IPv4 and IPv6. Strip credentials when present (e.g. http://user:pass@example.com/). Use that function in both HTTPRequest and WebSocketClient.
* | Fix `url_decode` with mixed percent-encoding/Unicode strings. Treat Unix ↵bruvzg2021-04-301-9/+10
| | | | | | | | drive names as UTF-8 encoded.
* | Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-271-4/+4
|/ | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
* Merge pull request #47512 from DanielKriz/bugfix/uri_encodeFabio Alessandrelli2021-04-101-2/+2
|\ | | | | fix wrong encoding format in uri_encode
| * fix wrong encoding in uri_encodeDaniel Kříž2021-04-101-2/+2
| |
* | Rename Array.invert() to Array.reverse()Marcel Admiraal2021-03-211-1/+1
|/ | | | | Does the same internally for List and Vector<>, which includes all PackedArray types.
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-2/+2
|
* Merge pull request #45545 from abaire/relaxes_gltf_name_sanitizationRémi Verschelde2021-03-091-0/+12
|\ | | | | Relaxes node name sanitization in gltf documents.
| * Relaxes Node naming constraints in glTF documents to match the Editor.abaire2021-02-241-0/+12
| |
* | Add support for numeric XML entities to XMLParserHenry Conklin2021-02-141-16/+46
|/ | | | | | | * Add support for decimal numeric entities to String::xml_unescape * Add more error checks to String::xml_unescape * Refactor XMLParser to use String::xml_unescape instead of an internal implementation
* Make String::ends_with don't use String::rfindkleonc2021-02-091-13/+20
|