summaryrefslogtreecommitdiffstats
path: root/core/io/json.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@c6c464cf9ae56e8b68620af65125dd980d0e8122Spartan3222024-11-021-1/+1
|\
| * [Core] Improve error messages with `vformat`A Thousand Ships2024-10-301-1/+1
| |
* | Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
| |
* | Merge commit godotengine/godot@b3bcb2dc14691f7729984128dca26a844f662fa1Spartan3222024-10-221-1/+1
|\|
| * [Core] Fix sorting of `Dictionary` keysA Thousand Ships2024-10-181-1/+1
| | | | | | | | `StringName` keys were sorted as `StringName` which is unstable.
* | Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Rebrand Godot to RedotRandolph W. Aarseth II2024-10-111-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Linux Editor tests workflow matrix Add Windows Editor w/ Mono workflow matrix Add Generate Glue Code job to Windows workflow Add Build GodotSharp job to Windows workflow Add godot compatibility version references Add Godot author info Add Godot version compatibility info Add Godot donor info Add Godot authors and donors to editor_about.cpp 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>
* Ability to convert native engine types to JSON and back.K. S. Ernest (iFire) Lee2024-08-291-1/+747
| | | | | | Implements support for all engine types in JSON encoding/decoding Co-Authored-By: Juan <reduzio@gmail.com> Co-Authored-By: Rémi Verschelde <rverschelde@gmail.com>
* Rename internal is_ascii_char to is_ascii_alphabet_charAaron Franke2024-04-201-2/+2
|
* [Core] Add iteration support to `Array`A Thousand Ships2024-04-101-4/+7
|
* Disallow invalid escape sequences in JSON.parseRedMser2023-06-301-1/+7
|
* Merge pull request #72288 from MewPurPur/use-string-repeatClay John2023-05-051-7/+1
|\ | | | | Use `String.repeat()` to optimize several String methods
| * Use String.repeat() in more placesVolTer2023-05-011-7/+1
| |
* | Modify JSON.stringify so that it doesn't create unnecessary empty lines from ↵Jakub Mateusz Marcowski2023-03-071-1/+4
|/ | | | empty arrays
* Fixes to JSON as resourceJuan Linietsky2023-01-141-8/+25
| | | | | | | | | | * It was not a resource, hence it was not working to load it as such. * Changed so, when opened in editor, a parse error will not fail load and the text will be kept. * This should allow proper editing from within the code editor, including syntax checking and saving files as-is in text. Partially addresses #66820. The code editor still needs to be changed for this to work.
* 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".
* Add recursion depth check to JSON stringify/parseRedMser2022-09-191-8/+15
|
* Treat JSON as resource files.Juan Linietsky2022-09-041-0/+86
| | | | | | | This makes the files ended in ".json" be treated as Godot resources. This solves two problems: * Avoid extensions to implement their own handling, which results in conflicts (all must use this one). * Allow code to still work opening it as a file (since it will not be imported).
* Make JSON methods statickobewi2022-08-161-6/+17
|
* Add a new HashSet templatereduz2022-05-201-2/+2
| | | | | * Intended to replace RBSet in most cases. * Optimized for iteration speed
* Replace most uses of Map by HashMapreduz2022-05-161-2/+2
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Cleanup and move char functions to the `char_utils.h` header.bruvzg2022-02-041-7/+7
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-1/+1
|
* Fix check for the first key in JSON stringify from Dictionary codeAaron Franke2021-07-241-1/+4
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-3/+3
|
* Consolidate JSON, JSONParseResults and JSONParser into JSONMarcel Admiraal2021-06-191-36/+21
| | | | | Renames JSON.parse_string() to parse() Renames JSON.decode_data() to stringify()
* Fix json dump and print of circular structureHaoyu Qiu2021-06-141-5/+16
|
* Increase String::num default decimal precisionHeikki Simojoki2021-05-291-5/+14
| | | | | | | | | | | | | | | | | | 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.
* Merge pull request #40804 from naithar/fix/json-parseRémi Verschelde2021-03-231-7/+15
|\ | | | | JSON parser fix
| * Core: add EOF check for json parserSergey Minakov2021-02-031-7/+15
| | | | | | | | Additionally reset parse result if error was found.
* | JSON parser: add UTF-16 surrogate pairs support.bruvzg2021-03-011-0/+46
|/
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-2/+2
|
* Create Variant built-in functions.reduz2020-11-101-0/+32
| | | | | | | -Moved Expression to use this, removed its own. -Eventually GDScript/VisualScript/GDNative need to be moved to this. -Given the JSON functions were hacked-in, removed them and created a new JSONParser class -Made sure these functions appear properly in documentation, since they will be removed from GDScript
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg2020-09-031-10/+10
|
* Make all String float conversion methods be 64-bitAaron Franke2020-07-271-1/+1
|
* issue-40396 - Added missing error strings to JSON parsing when array or ↵Adam Bates2020-07-221-0/+2
| | | | object is never closed.
* Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-191-9/+9
| | | | | | | | | | Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-16/+28
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-43/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-10/+25
| | | | Part of #33027.
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-3/+5
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-3/+3
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Remove more deprecated methods and codeRémi Verschelde2020-02-131-8/+2
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Remove unnecessary code and add some error explanationsqarmin2019-07-011-2/+0
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+2
| | | | | | 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.