Skip to content

feat(libSceJson2): implement Object::insert - #25

Open
p3n1cillin wants to merge 1 commit into
claude/trusting-ride-71wfl7from
claude/json2-object-insert
Open

p3n1cillin wants to merge 1 commit into
claude/trusting-ride-71wfl7from
claude/json2-object-insert

Conversation

@p3n1cillin

@p3n1cillin p3n1cillin commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Staged for upstream. Open it on boykopovar/AnyPS5 only after the PRs ahead of it are merged or closed (one open PR per author until one is merged).

What

Implements sce::Json::Object::insert(const Pair&), which PPSA30601 imports (its TechnicalDebt entry listed it among six members declared without parameters).

  • The mangled name does not encode a return type, which is why feat(libSceJson2): implement Array::iterator assignment, postfix increment and Object::Pair boykopovar/AnyPS5#4476 leaves insert as a stub. The PS Vita sce::Json declaration in vitasdk gives it: iterator insert(const Pair& p), returning an iterator to the inserted pair. The iterator is returned through the hidden result pointer, like Object::begin, end and find here.
  • The pair is copied to the end of the object, so iteration and serialization keep insertion order, as operator[] does.
  • Inserting a key the object already has throws, because whether the console replaces, keeps or duplicates the pair is unknown. A null pair throws.
  • TechnicalDebt gets an entry for insert, and the PPSA30601 entry now lists five remaining members.
  • guest_json covers the returned iterator, the copy being independent of the caller's pair, insertion order in serialization, and the duplicate-key throw leaving the object unchanged.

Progress: libSceJson2 104/116 → 105/116.

Overlap: boykopovar#4476 replaces the neighbouring Object::Pair and Array::iterator stubs in the same file and edits the same PPSA30601 TechnicalDebt line. Whichever merges second needs a trivial rebase. Neither depends on the other.

Tested

Linux (Ubuntu 24.04, GCC 13.3), BUILD_TESTING=ON: guest_json passes. Removing the duplicate-key check makes it fail. python3 tools/check_conventions.py --base origin/main passes. No title tested.

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
  • Unblocks: none
  • AI-assisted: yes

🤖 Generated with Claude Code

https://claude.ai/code/session_01MCDdgs7PAcZLroePUFgxob

Copy the pair to the end of the object and return an iterator to it, as the
PS Vita sce::Json declaration in vitasdk describes. A key the object already
has throws because the console's behaviour for it is unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MCDdgs7PAcZLroePUFgxob
@github-actions

Copy link
Copy Markdown

Progress report (2a5eca1 → 075239f)

📈 System libraries: 86.36% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceJson2 _ZN3sce4Json6Object6insertERKNS1_4PairE

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants