feat(libSceJson2): implement remaining iterator and handler functions #4791

Closed
PayloadAnim wants to merge 2 commits from upstream-pr/4791 into main
PayloadAnim commented 2026-10-12 22:05:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PayloadAnim on 2026-10-12T22:05:08Z.


What

Implements all 12 remaining NotImplemented_nid_no_patch stubs in libSceJson2:

  • MemAllocator::notifyError - accepts error, size, and context parameters
  • Value::setNullAccessCallBack - registers callback using existing State() infrastructure
  • Value::setElementAccessFailureHandler - stores handler (stub)
  • Value::setSpecialFloatHandler - stores handler (stub)
  • Value::setTypeMismatchHandler - stores handler (stub)
  • Value::operator bool() - returns false for null, boolean value for booleans, true otherwise
  • Object::Pair constructor - constructs key and value with reserved field
  • Object::Pair destructor - destroys key and value
  • Object::insert - copies and appends pair to object items
  • Array::iterator::operator++(int) - post-increment, returns old value
  • Array::iterator::operator= - assignment operator
  • Array::iterator default constructor - placement-new on iterator member

All implementations follow existing patterns in the file. Handler setters accept callbacks but don't invoke them, matching
InitParameter behavior. Iterator operations wrap std::list<T>::iterator.

Tested

Windows, built with cmake --build build --target libSceJson2. No runtime tests; signatures inferred from PPSA30601 imports.

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 under Silent stubs in their library's technical
    debt file
  • 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
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4835526428 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4791). Originally posted by [PayloadAnim](https://github.com/PayloadAnim) on 2026-10-12T22:05:08Z. --- ### What Implements all 12 remaining `NotImplemented_nid_no_patch` stubs in libSceJson2: - `MemAllocator::notifyError` - accepts error, size, and context parameters - `Value::setNullAccessCallBack` - registers callback using existing `State()` infrastructure - `Value::setElementAccessFailureHandler` - stores handler (stub) - `Value::setSpecialFloatHandler` - stores handler (stub) - `Value::setTypeMismatchHandler` - stores handler (stub) - `Value::operator bool()` - returns `false` for null, boolean value for booleans, `true` otherwise - `Object::Pair` constructor - constructs key and value with reserved field - `Object::Pair` destructor - destroys key and value - `Object::insert` - copies and appends pair to object items - `Array::iterator::operator++(int)` - post-increment, returns old value - `Array::iterator::operator=` - assignment operator - `Array::iterator` default constructor - placement-new on iterator member All implementations follow existing patterns in the file. Handler setters accept callbacks but don't invoke them, matching `InitParameter` behavior. Iterator operations wrap `std::list<T>::iterator`. ### Tested Windows, built with `cmake --build build --target libSceJson2`. No runtime tests; signatures inferred from PPSA30601 imports. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [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] Unblocks: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-12 22:18:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T22:18:45Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#4476 core/libs/prx/libSceJson2/Export.cpp L899-911, L913-927 _ZN3sce4Json5Array8iteratorC1Ev
_ZN3sce4Json5Array8iteratoraSERKS2_
_ZN3sce4Json5Array8iteratorppEi
_ZN3sce4Json6Object4PairC1ERKNS0_6StringERKNS0_5ValueE
_ZN3sce4Json6Object4PairD1Ev
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6133653001 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4791#issuecomment-6133653001). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T22:18:45Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #4476 | `core/libs/prx/libSceJson2/Export.cpp` [L899-911](https://github.com/boykopovar/AnyPS5/blob/30caf2b2a5641764312a5586eebe888e4074a209/core/libs/prx/libSceJson2/Export.cpp#L899-L911), [L913-927](https://github.com/boykopovar/AnyPS5/blob/30caf2b2a5641764312a5586eebe888e4074a209/core/libs/prx/libSceJson2/Export.cpp#L913-L927) | `_ZN3sce4Json5Array8iteratorC1Ev`<br>`_ZN3sce4Json5Array8iteratoraSERKS2_`<br>`_ZN3sce4Json5Array8iteratorppEi`<br>`_ZN3sce4Json6Object4PairC1ERKNS0_6StringERKNS0_5ValueE`<br>`_ZN3sce4Json6Object4PairD1Ev` | |
github-actions[bot] commented 2026-10-13 07:27:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T07:27:02Z.


Progress report (43e3a70 → f0cc4a7)

📈 System libraries: 88.25% (+0.38%, +14 implemented functions)

✅ 14 implemented
Library Name
libSceAppContent sceAppContentAddcontEnqueueDownload
libSceAppContent sceAppContentGetAddcontDownloadProgress
libSceJson2 _ZN3sce4Json12MemAllocator11notifyErrorEimPv
libSceJson2 _ZN3sce4Json5Array8iteratorC1Ev
libSceJson2 _ZN3sce4Json5Array8iteratoraSERKS2_
libSceJson2 _ZN3sce4Json5Array8iteratorppEi
libSceJson2 _ZN3sce4Json5Value21setNullAccessCallBackEPFRKS1_NS0_9ValueTypeEPS2_PvES6_
libSceJson2 _ZN3sce4Json5Value22setSpecialFloatHandlerEPFKS1_NS0_12FunctionTypeEdPS2_PvPbES5_
libSceJson2 _ZN3sce4Json5Value22setTypeMismatchHandlerEPFRKS1_NS0_9ValueTypeEPS2_S5_PvES6_
libSceJson2 _ZN3sce4Json5Value30setElementAccessFailureHandlerEPFviPKNS0_6StringEPKmPKS1_S8_PvES9_
libSceJson2 _ZN3sce4Json6Object4PairC1ERKNS0_6StringERKNS0_5ValueE
libSceJson2 _ZN3sce4Json6Object4PairD1Ev
libSceJson2 _ZN3sce4Json6Object6insertERKNS1_4PairE
libSceJson2 _ZNK3sce4Json5ValuecvbEv
⚪ 4 behaviourally empty (constant return or throw)
Library Name
libSceJson2 _ZN3sce4Json12MemAllocator11notifyErrorEimPv
libSceJson2 _ZN3sce4Json5Value22setSpecialFloatHandlerEPFKS1_NS0_12FunctionTypeEdPS2_PvPbES5_
libSceJson2 _ZN3sce4Json5Value22setTypeMismatchHandlerEPFRKS1_NS0_9ValueTypeEPS2_S5_PvES6_
libSceJson2 _ZN3sce4Json5Value30setElementAccessFailureHandlerEPFviPKNS0_6StringEPKmPKS1_S8_PvES9_
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140544526 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4791#issuecomment-6140544526). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T07:27:02Z. --- <!-- progress-report --> ### Progress report (43e3a70 → f0cc4a7) 📈 **System libraries**: 88.25% (+0.38%, +14 implemented functions) <details> <summary>✅ 14 implemented</summary> | Library | Name | | - | - | | libSceAppContent | `sceAppContentAddcontEnqueueDownload` | | libSceAppContent | `sceAppContentGetAddcontDownloadProgress` | | libSceJson2 | `_ZN3sce4Json12MemAllocator11notifyErrorEimPv` | | libSceJson2 | `_ZN3sce4Json5Array8iteratorC1Ev` | | libSceJson2 | `_ZN3sce4Json5Array8iteratoraSERKS2_` | | libSceJson2 | `_ZN3sce4Json5Array8iteratorppEi` | | libSceJson2 | `_ZN3sce4Json5Value21setNullAccessCallBackEPFRKS1_NS0_9ValueTypeEPS2_PvES6_` | | libSceJson2 | `_ZN3sce4Json5Value22setSpecialFloatHandlerEPFKS1_NS0_12FunctionTypeEdPS2_PvPbES5_` | | libSceJson2 | `_ZN3sce4Json5Value22setTypeMismatchHandlerEPFRKS1_NS0_9ValueTypeEPS2_S5_PvES6_` | | libSceJson2 | `_ZN3sce4Json5Value30setElementAccessFailureHandlerEPFviPKNS0_6StringEPKmPKS1_S8_PvES9_` | | libSceJson2 | `_ZN3sce4Json6Object4PairC1ERKNS0_6StringERKNS0_5ValueE` | | libSceJson2 | `_ZN3sce4Json6Object4PairD1Ev` | | libSceJson2 | `_ZN3sce4Json6Object6insertERKNS1_4PairE` | | libSceJson2 | `_ZNK3sce4Json5ValuecvbEv` | </details> <details> <summary>⚪ 4 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceJson2 | `_ZN3sce4Json12MemAllocator11notifyErrorEimPv` | | libSceJson2 | `_ZN3sce4Json5Value22setSpecialFloatHandlerEPFKS1_NS0_12FunctionTypeEdPS2_PvPbES5_` | | libSceJson2 | `_ZN3sce4Json5Value22setTypeMismatchHandlerEPFRKS1_NS0_9ValueTypeEPS2_S5_PvES6_` | | libSceJson2 | `_ZN3sce4Json5Value30setElementAccessFailureHandlerEPFviPKNS0_6StringEPKmPKS1_S8_PvES9_` | </details>
adriadam10 commented 2026-10-13 07:27:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T07:27:13Z.


Closing, with the concrete reasons so it can be reopened addressed:

  • Two topics in one PR: libSceJson2 (12 exports) and libSceAppContent (sceAppContentAddcontEnqueueDownload, sceAppContentGetAddcontDownloadProgress). The body only describes the Json2 part.
  • Array::iterator::operator++(int) (libSceJson2/Export.cpp): it increments self->it and then does *self = copy, which undoes the increment, and it returns self instead of the old value. Post-increment is effectively a no-op.
  • Overlap with #4476: it already implements Array::iterator ctor/operator=/operator++(int) and Object::Pair ctor/dtor. Please coordinate there and list it under Depends on if you build on it.
  • libSceAppContent: the new signatures, the SceAppContentAddcontDownloadProgress layout and the always-DRM_NO_ENTITLEMENT result have no cited source and no TechnicalDebt entry.
  • The handler setters (setElementAccessFailureHandler, setSpecialFloatHandler, setTypeMismatchHandler, notifyError) discard their arguments and return success: these are silent stubs and must either be modelled or keep throwing.
  • No tests (the PR says "No runtime tests"), and the Conventions check fails.

Welcome to reopen as one PR per library, without the overlap, with a test that pins the iterator semantics.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140547306 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4791#issuecomment-6140547306). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T07:27:13Z. --- Closing, with the concrete reasons so it can be reopened addressed: - Two topics in one PR: libSceJson2 (12 exports) and libSceAppContent (`sceAppContentAddcontEnqueueDownload`, `sceAppContentGetAddcontDownloadProgress`). The body only describes the Json2 part. - `Array::iterator::operator++(int)` (`libSceJson2/Export.cpp`): it increments `self->it` and then does `*self = copy`, which undoes the increment, and it returns `self` instead of the old value. Post-increment is effectively a no-op. - Overlap with #4476: it already implements `Array::iterator` ctor/`operator=`/`operator++(int)` and `Object::Pair` ctor/dtor. Please coordinate there and list it under Depends on if you build on it. - libSceAppContent: the new signatures, the `SceAppContentAddcontDownloadProgress` layout and the always-`DRM_NO_ENTITLEMENT` result have no cited source and no TechnicalDebt entry. - The handler setters (`setElementAccessFailureHandler`, `setSpecialFloatHandler`, `setTypeMismatchHandler`, `notifyError`) discard their arguments and return success: these are silent stubs and must either be modelled or keep throwing. - No tests (the PR says "No runtime tests"), and the Conventions check fails. Welcome to reopen as one PR per library, without the overlap, with a test that pins the iterator semantics.

Pull request closed

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!4791
No description provided.