feat(libSceJson2): implement sce::Json::String at, find and rfind #10212
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10212"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by noamroger on 2026-10-23T13:56:34Z.
What
Implements seven of the libSceJson2 exports declared as pending in
be37cb907:sce::Json::String::at(size_t),find(const char*, size_t),find(const char*, size_t, size_t),find(const String&, size_t), and the three matchingrfindoverloads. Their pending declarations are removed fromInventoryExports.cpp.The return types (
charforat, a size forfind/rfind,String::nposwhen not found) follow the PS Vita library'sStringin vitasdk json.h, already cited in the library's debt file; the search followsstd::string, as the existingfind(char)/rfind(char)do.atpast the end, a null text, and a nullStringthrow; the console's behaviour there is unverified and recorded indocs/dev/debt/libSceJson2.md. A null text with a zero length is accepted as an empty needle.Tested
Ubuntu 24.04, GCC 13.3:
GuestJson.cppbuilt againstlibSceJson2/Export.cppand run; it passes. The new checks inStringMethodscover each overload (match, no match,posin the middle, empty needle at and past the end,nposstart forrfind, partial-length needle,Stringneedle) and the throwing paths foratand null text. Also run under ASan/UBSan: no new findings (a 48-byte leak inArray::begin/endis reported identically onmain). Not run through the full CMake build.tools/check_conventions.py --base origin/mainpasses. No title tested.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T13:58:05Z.
Review: APPROVED
Reviewed exact head
1aab236614c9b579d627b99f4f5fca62c0de2fd2. This is a focused implementation of the seven listedString::at,find, andrfindoverloads, replaces the matching pending exports, adds overload and boundary tests, and records the unverified console behavior for invalid inputs in the debt entry. The changes are limited to the implementation, its tests and debt documentation. The template records AI assistance, and its checked items pass the repository conventions checker.I independently ran
tools/check_conventions.pyagainst this head andgit diff --check; both passed. I built the actualGuestJson.cpptest with this head'slibSceJson2/Export.cppusing GCC C++20 with AddressSanitizer and UndefinedBehaviorSanitizer, then ran it successfully (ASAN_OPTIONS=detect_leaks=0; exit 0). Leak detection was disabled for this local run, so this does not independently verify the author's reported leak comparison. Hosted conventions, intake and labels checks pass. The author's Ubuntu test and sanitizer report is consistent with the focused coverage; no full CMake build or console test was run here. Approving this exact head.