feat(libSceJson2): implement sce::Json::Value::clear #1204

Merged
CyanBook merged 1 commit from upstream-pr/1204 into main 2026-10-08 09:17:58 +00:00
CyanBook commented 2026-10-07 17:32:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CyanBook on 2026-10-07T17:32:20Z.


What

sce::Json::Value::clear() (_ZN3sce4Json5Value5clearEv) in libSceJson2 was stubbed with NotImplemented_nid_no_patch.

Value::clear now releases any heap resources owned by the value (strings, arrays, objects) via Clear(NodeOf(*self)) and resets its type back to TypeNull, matching the existing behaviour of Object::clear().

GuestJson.cpp gains ValueClear(), verifying that calling clear() on null, integer, string, and object values resets them to TypeNull and allows subsequent reuse.

Tested

  • Windows 11:
    • python tools/check_conventions.py --base origin/main passes with zero errors.
    • python tools/progress.py out confirms libSceJson2 moves from 89/92 (96.7%) to 90/92 (97.8%) and total libraries increase to 2517/2925 (86.05%).
    • Full build left to CI runner.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4776179868 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1204). Originally posted by [CyanBook](https://github.com/CyanBook) on 2026-10-07T17:32:20Z. --- ### What `sce::Json::Value::clear()` (`_ZN3sce4Json5Value5clearEv`) in `libSceJson2` was stubbed with `NotImplemented_nid_no_patch`. `Value::clear` now releases any heap resources owned by the value (strings, arrays, objects) via `Clear(NodeOf(*self))` and resets its type back to `TypeNull`, matching the existing behaviour of `Object::clear()`. `GuestJson.cpp` gains `ValueClear()`, verifying that calling `clear()` on null, integer, string, and object values resets them to `TypeNull` and allows subsequent reuse. ### Tested - Windows 11: - `python tools/check_conventions.py --base origin/main` passes with zero errors. - `python tools/progress.py out` confirms `libSceJson2` moves from 89/92 (96.7%) to 90/92 (97.8%) and total libraries increase to 2517/2925 (86.05%). - Full build left to CI runner. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
adriadam10 commented 2026-10-08 09:17:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T09:17:54Z.


Checked: build + full ctest green locally (guest_json passes); the new ValueClear test fails with the Export.cpp change reverted. clear() goes through the same Clear(NodeOf(*self)) path as Value::set(Array/Object), so strings/arrays/objects are released and the value returns to TypeNull. Merging once CI is green (your runs were waiting for approval; I approved them).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6056710583 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1204#issuecomment-6056710583). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T09:17:54Z. --- Checked: build + full ctest green locally (guest_json passes); the new `ValueClear` test fails with the `Export.cpp` change reverted. `clear()` goes through the same `Clear(NodeOf(*self))` path as `Value::set(Array/Object)`, so strings/arrays/objects are released and the value returns to `TypeNull`. Merging once CI is green (your runs were waiting for approval; I approved them).
github-actions[bot] commented 2026-10-08 09:38:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T09:38:47Z.


Progress report (cea1ef1 → cbc5b4c)

📈 System libraries: 86.05% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceJson2 _ZN3sce4Json5Value5clearEv
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6057049743 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1204#issuecomment-6057049743). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T09:38:47Z. --- <!-- progress-report --> ### Progress report (cea1ef1 → cbc5b4c) 📈 **System libraries**: 86.05% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceJson2 | `_ZN3sce4Json5Value5clearEv` | </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1204
No description provided.