summaryrefslogtreecommitdiffstats
path: root/core/ustring.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * Create a GDScript String function repeatBhupendra Aole2019-09-031-0/+16
| | | | | | | | Fixes #30610
* | Merge pull request #32273 from Calinou/humanize-size-fix-i18nRémi Verschelde2019-09-231-5/+13
|\ \ | | | | | | Fix i18n in `String::humanize_size()`
| * | Fix i18n in `String::humanize_size()`Hugo Locurcio2019-09-231-5/+13
| | | | | | | | | | | | | | | Calls to `RTR()` must be added to each string so the PO file generator can pick them up.
* | | Changed some code found by Clang Tidy and Coverityqarmin2019-09-221-2/+2
|/ /
* / Improve the `String::humanize_size()` methodHugo Locurcio2019-09-051-2/+2
|/ | | | | | | | | - Use "B" insted of "Bytes" to be more compact - Use suffixes that denote a binary prefix - Make suffixes localizable This removes the need for the custom `EditorNetworkProfiler:_format_bandwidth()` method.
* Add forgotten pointer checkingqarmin2019-08-241-1/+1
|
* Merge pull request #31513 from qarmin/int_overflowRémi Verschelde2019-08-231-0/+15
|\ | | | | Prevent int overflow and underflow
| * Prevent int overflow and underflowqarmin2019-08-221-0/+15
| |
* | Move CryptoCore to it's own folder.Fabio Alessandrelli2019-08-191-1/+1
|/ | | | Crypto classes will be placed in core/crypto.
* Added count method to StringChaosus2019-07-231-0/+45
|
* Add NULL-terminator the string passed to strtol.Fabio Alessandrelli2019-07-081-1/+1
| | | | | | This is actually expected by the function although it was apparently working in GCC without the terminator, it breaks (at least some) clang versions.
* Fixes minor issues found by static analyzerqarmin2019-07-071-1/+1
|
* Add sha1 functions to string (using new CryptoCore)Fabio Alessandrelli2019-07-031-0/+21
|
* CryptoCore class to access to base crypto utils.Fabio Alessandrelli2019-07-021-24/+10
| | | | | | | | | | | | | | | | | | Godot core needs MD5/SHA256/AES/Base64 which used to be provided by separate libraries. Since we bundle mbedtls in most cases, and we can easily only include the needed sources if we so desire, let's use it. To simplify library changes in the future, and better isolate header dependencies all functions have been wrapped around inside a class in `core/math/crypto_base.h`. If the mbedtls module is disabled, we only bundle the needed source files independently of the `builtin_mbedtls` option. If the module is enabled, the `builtin_mbedtls` option works as usual. Also remove some unused headers from StreamPeerMbedTLS which were causing build issues.
* Remove unnecessary code and add some error explanationsqarmin2019-07-011-6/+0
|
* Some code changed with Clang-Tidyqarmin2019-06-261-6/+1
|
* Merge pull request #28648 from KoBeWi/substr-1Rémi Verschelde2019-06-191-0/+3
|\ | | | | Make second parameter of substr optional
| * Make second parameter of substr optionalTomasz Chabora2019-05-031-0/+3
| |
* | Merge pull request #29616 from Calinou/humanize-size-clearer-roundingRémi Verschelde2019-06-121-1/+1
|\ \ | | | | | | Make humanized size rounding clearer by padding decimals with zeroes
| * | Make humanized size rounding clearer by padding decimals with zeroesHugo Locurcio2019-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | For example, "5 MB" will now be displayed as "5.00 MB" to make the rounding precision clear, regardless of the value being rounded. This closes #29611.
* | | Merge pull request #29615 from Calinou/fix-editor-monitor-large-sizesRémi Verschelde2019-06-121-1/+1
|\ \ \ | | | | | | | | Fix display of large sizes in the editor monitors
| * | | Fix display of large sizes in the editor monitorsHugo Locurcio2019-06-081-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike the old custom method, the `String::humanize_size()` method works well with file sizes above 2 GB. This also tweaks the suffixes for spacing consistency and uses the correct acronym for exabytes (EB). This closes #29610.
* | | Merge pull request #29306 from qarmin/small_code_fixesRémi Verschelde2019-06-121-18/+4
|\ \ \ | |/ / |/| | Small fixes to unrechable code, possibly overflows, using NULL pointers
| * | Small fixes to unrechable code, possibly overflows, using NULL pointersqarmin2019-06-031-18/+4
| | |
* | | Fix and expose String::strip_escapes(), use it in LineEdit pasteRémi Verschelde2019-05-311-19/+6
|/ / | | | | | | Supersedes #27736.
* / Support for binary literals in GDScript. Added an error that shows if a ↵jude-lafitteIII2019-04-251-0/+39
|/ | | | point is written in a hex literal. Added highlighting for binary literals in GDScript
* fixed an access after free in OS_X11::set_context.Ibrahn Sahir2019-04-221-0/+25
| | | | | | | | Added constructor and assignment operator for CharString from const char* to simplify memory management when working with utf8/ascii strings for APIs taking char*. Reworked OS_X11::set_context to use CharString and avoid some manual memory management.
* Add ability to edit editor feature profilesJuan Linietsky2019-04-081-0/+18
| | | | Allows enabling/disabling parts of the editor and storing/loading profiles for that.
* Don't crash when parse_utf8 receives a NULL pointerHein-Pieter van Braam2019-02-221-0/+3
| | | | | This can happen when chaining calls to various string methods when the string is empty.
* Fix warnings seen with -Wignored-qualifiers.marxin2019-02-211-1/+1
|
* Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-4/+4
| | | | Fixes #25316.
* Fix wrong bounds check in String::rightlupoDharkael2019-02-201-4/+4
|
* Repair String lstrip and rstrip.Ibrahn Sahir2019-01-071-2/+6
| | | | | | | | | | | Background: lstrip and rstrip were broken by changes to String in: 0e29f7974b59e4440cf02e1388fb9d8ab2b5c5fd which removed it's access to Vector::find(CharType). Moved Vector's find up into CowData so it can be shared by Vector and String. Added String::find_char using CowData::find. Implemented rstrip and lstrip using find_char. Added a few tests for String rstrip and lstrip.
* Merge pull request #21708 from hpvb/fix-21242v2Hein-Pieter van Braam2019-01-041-0/+3
|\ | | | | String[size()] should return a default constructed CharType
| * String[size()] should return a default constructed CharTypeHein-Pieter van Braam2019-01-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | As per the C++ standard 21.3.4.1 for std::string: Returns: If pos < size(), returns data()[pos]. Otherwise, if pos == size(), the const version returns charT(). Otherwise, the behavior is undefined. Since the behavior is undefined Godot now does the same thing for const and non-const versions of operator[]. This fixes #21242 and fixes #22221.
* | Merge pull request #24585 from Xrayez/fix-crash-hex-numberRémi Verschelde2019-01-041-1/+4
|\ \ | |/ |/| Fix crash when checking empty string for valid hex number
| * Fix crash when checking empty string for valid hex numberAndrii Doroshenko (Xrayez)2018-12-241-1/+4
| |
* | Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Reduce String CoWHein-Pieter van Braam2018-12-161-5/+5
| | | | | | | | By introducing an intermediate proxy class for the array subscript operator for String and CharString we can control better when CowData will actually CoW. This should improve performance of String usage for most cases.
* Fix formatting -0.0 by %+f displays +-0.0Poommetee Ketson2018-11-091-1/+1
|
* Merge pull request #23159 from DavidSichma/string-escapeJuan Linietsky2018-11-011-9/+5
|\ | | | | Fix: String::format Variant to String conversion
| * Fix: String::format Variant to String conversionDavid Sichma2018-10-251-9/+5
| | | | | | | | | | | | | | | | | | | | | | Previosly String::format used variant.get_construct_string() to convert the passed Variants to Strings. This however did not match the expected printing behavior of some datatypes: Strings for example turned out escaped. This fix replaces the call to get_construct_string() with a simple conversion. This makes String::format consistent with "%s" % "sth" and formated Variants turn out like printed as expected.
* | Fixing warnings generated by MSVCDualtagh Murray2018-10-191-1/+1
|/ | | | Fixes #22684.
* Make visualscript search better.K. S. Ernest (iFire) Lee2018-10-111-1/+14
| | | | | | | | | * There were spaces unequally inside the function definitions. * camelcase_to_underscore() should also work for numbers inside of the camel case. * Removed the builtin concept * Capitalize descriptions from methods too. * Match the visual script functions by removing the empty arguments "( )" * Add some test cases
* fixes #22828 - res://user had incorrect substr valueexts2018-10-071-1/+1
|
* Fix some more warnings reported by CIRémi Verschelde2018-10-031-2/+2
| | | | | | | | | | | | | | | | Fixes the following Clang 7 warnings: ``` core/io/marshalls.cpp:872:10: warning: unused variable 'f' [-Wunused-variable] core/ustring.cpp:1831:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] core/ustring.cpp:1832:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] drivers/gles3/rasterizer_gles3.cpp:82:24: warning: unused function '_gl_debug_print' [-Wunused-function,34] main/main.cpp:118:13: warning: unused variable 'auto_build_solutions' [-Wunused-variable] modules/csg/csg_gizmos.cpp:225:46: warning: 'current' may be used uninitialized in this function [-Wmaybe-uninitialized] ```
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-8/+7
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Make some debug prints verbose-only, remove othersRémi Verschelde2018-08-241-1/+1
|
* Merge pull request #20443 from AlexHolly/add-string-format-no-indexRémi Verschelde2018-08-141-1/+5
|\ | | | | Added String.format "no index" support
| * Added String.format "no index" supportAlexander Holland2018-07-251-1/+5
| |