summaryrefslogtreecommitdiff
path: root/core/ustring.cpp
AgeCommit message (Collapse)Author
2019-04-22fixed an access after free in OS_X11::set_context.Ibrahn Sahir
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.
2019-04-08Add ability to edit editor feature profilesJuan Linietsky
Allows enabling/disabling parts of the editor and storing/loading profiles for that.
2019-02-22Don't crash when parse_utf8 receives a NULL pointerHein-Pieter van Braam
This can happen when chaining calls to various string methods when the string is empty.
2019-02-21Fix warnings seen with -Wignored-qualifiers.marxin
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-02-20Fix wrong bounds check in String::rightlupoDharkael
2019-01-07Repair String lstrip and rstrip.Ibrahn Sahir
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.
2019-01-04Merge pull request #21708 from hpvb/fix-21242v2Hein-Pieter van Braam
String[size()] should return a default constructed CharType
2019-01-04String[size()] should return a default constructed CharTypeHein-Pieter van Braam
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.
2019-01-04Merge pull request #24585 from Xrayez/fix-crash-hex-numberRémi Verschelde
Fix crash when checking empty string for valid hex number
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-24Fix crash when checking empty string for valid hex numberAndrii Doroshenko (Xrayez)
2018-12-16Reduce String CoWHein-Pieter van Braam
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.
2018-11-09Fix formatting -0.0 by %+f displays +-0.0Poommetee Ketson
2018-11-01Merge pull request #23159 from DavidSichma/string-escapeJuan Linietsky
Fix: String::format Variant to String conversion
2018-10-25Fix: String::format Variant to String conversionDavid Sichma
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.
2018-10-19Fixing warnings generated by MSVCDualtagh Murray
Fixes #22684.
2018-10-11Make visualscript search better.K. S. Ernest (iFire) Lee
* 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
2018-10-07fixes #22828 - res://user had incorrect substr valueexts
2018-10-03Fix some more warnings reported by CIRémi Verschelde
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] ```
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
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.
2018-08-24Make some debug prints verbose-only, remove othersRémi Verschelde
2018-08-14Merge pull request #20443 from AlexHolly/add-string-format-no-indexRémi Verschelde
Added String.format "no index" support
2018-08-14Merge pull request #20772 from dragmz/string_copy_oob_read_fixRémi Verschelde
Fix out of buffer read when copying from a non-null-terminated string
2018-08-07removed some surplus null appends that got typoed in ↵Ibrahn Sahir
0e29f7974b59e4440cf02e1388fb9d8ab2b5c5fd A couple of null appends got typoed to append a '0' character instead. Removed them here since String already takes care of the null terminator for us.
2018-08-06fix out of buffer read when copying non-null terminated stringsMarcin Zawiejski
2018-07-26Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam
This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
2018-07-25Added String.format "no index" supportAlexander Holland
2018-07-25Fix format ignores case in placeholderAlexander Holland
2018-07-24removed redundant strlen calculation from String::substrIbrahn Sahir
2018-07-22Fix upper/lower case convertion for characters >= 0x80Marcelo Fernandez
2018-07-17reworked ustring.rsplit to fix behaviour.Ibrahn Sahir
Previous problems include failure to remove the splitter from the last element found and a possible infinite loop dealing with multi-character splitter strings.
2018-05-23Merge pull request #14715 from Krakean/string_add_rsplit2Max Hilbrunner
Added rsplit() method to String class
2018-05-07Merge pull request #17316 from ShyRed/significantdigitsJuan Linietsky
Adjust decimal precision
2018-04-30fix API string pathPaul Joannon
2018-04-22Merge pull request #18176 from nikibobi/string-trimGeorge Marques
Add string trim_prefix, trim_suffix, lstrip and rstrip methods
2018-04-18Fix some Coverity warnings in String APIRémi Verschelde
- StringName::StringName(const StringName &p_name) Non-static class member _data is not initialized in this constructor nor in any functions that it calls. - StringName::_Data() Non-static class member idx is not initialized in this constructor nor in any functions that it calls. - String::num_uint64(...) This less-than-zero comparison of an unsigned value is never true. n % base < 0UL. - String::hex_to_int(...) and String::hex_to_int64(...) Execution cannot reach this statement (deadcode)
2018-04-17add string trim_prefix trim_suffix lstrip and rstrip methodsbosak
2018-04-12Revert "Unify http- and percent- encode/decode"Pedro J. Estébanez
This reverts commit b76ee30917c63211ac9e94a21bebbddf518d169f.
2018-04-05Fix buggy percent-encodingPedro J. Estébanez
Fixes #17875.
2018-03-27Unify http- and percent- encode/decodePedro J. Estébanez
There was a percent-prefixed version, which was exposed, and a http-prefixed version which was not (only to GDNative). This commit keeps the percent-prefixed versions, but with the http-prefixed implementations.
2018-03-06Adjust decimal precisionShyRed
Increase the number of significant digits when converting from double to string.
2018-02-25Mono: Better versioning and gracefully unloading of Godot API assembliesIgnacio Etcheverry
2018-01-18improves portability with some compilersAriel Manzur
2018-01-18Fix typos in code and docs with codespellRémi Verschelde
Using v1.11.0 from https://github.com/lucasdemarchi/codespell
2018-01-15Filled tutorial field in most relevent classes.Juan Linietsky
Added tutorial display in doc.
2018-01-13Fix String::itos/String::num_int64(INT64_MIN) output.bruvzg
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-01-01Merge pull request #14973 from poke1024/docs-word-selectionNoshyaar
Double-click word selection for RichTextLabel (i.e. docs)