Age | Commit message (Collapse) | Author |
|
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.
|
|
filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implements https://github.com/godotengine/godot-proposals/issues/4096
* Nodes can be marked unique to the scene in the editor (or via code).
* Unique nodes can be accessed via the **%** prefix at any point in the path. From that point in the path (depending on whether the scene of the path is), the unique node will be fetched.
* Implementation is very optimal, as these nodes are cached.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These are not used consistently and some can conflict with
system-specific defines. While here, also delete some unused macros.
|
|
|
|
Happy new year to the wonderful Godot community!
|
|
* 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`.
|
|
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
|
|
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).
|
|
|
|
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>
|
|
|
|
|
|
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
|
|
|
|
|
|
|
|
|
|
|
|
Godot 3.3 and later require Visual Studio 2017 to be compiled.
|
|
|
|
This is a fix for https://github.com/godotengine/godot/issues/52048
|
|
We're using the standard library in many core classes by now so
this code path no longer makes sense.
|
|
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`.
|
|
Add new inline functions to check if a character is lowercase or uppercase.
Remove unused upper case macro.
|
|
|
|
|
|
String::format leave passed values untouched
|
|
Method from `String`
|
|
fix url parsing with port numbers
|
|
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)
|
|
Rename `String.is_abs_path()` to `String.is_absolute_path()`
|
|
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```
|
|
If the passed value or key contains double quotation marks it will no
longer get removed.
|
|
This is more consistent with `NodePath.is_absolute()`.
|
|
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.
|