8 Commits
Author SHA1 Message Date
Daksh Mamodiya 7cca8540ca string(JSON): Add ARRAY_SPLIT mode for linear array iteration
Iterating a JSON array with GET re-parses the entire string on every
call, so walking N elements is O(N^2).  ARRAY_SPLIT parses the array
once and returns its elements as a CMake list, letting each element be
queried individually in linear total time.

Each element is re-serialized as compact JSON and encoded to survive
CMake list parsing: '[' and ']' inside strings are emitted as \u005B
and \u005D, and ';' is escaped as '\;'.  Every element therefore stays
valid, re-queryable JSON.

Fixes: #27985
2026-08-07 17:45:50 +02:00
Tyler Yankee 76026ce818 Tests/string(JSON): Add comments to test case
Verify that our current JSON parsing allows comments (but throws them
away).
2026-08-03 19:52:53 -04:00
Taylor Sasser b14da400de string(JSON): Add PARTIAL_EQUAL for subset style JSON comparisons
Fixes: #27641
2026-04-21 08:41:49 -04:00
Kyle Edwards 1eb5ea3a64 Help(string(JSON)): Clarify that some modes can have zero members/indices 2025-12-16 11:14:16 -05:00
Kyle Edwards 06e6f1e69f string(JSON): Add STRING_ENCODE mode 2025-12-16 10:11:30 -05:00
Kyle Edwards 15973ff247 string(JSON): Add GET_RAW mode 2025-12-16 10:00:29 -05:00
Sean Kahler e0d3e6e147 string(JSON): Fix typo in error message
`s/then/than/` in a comparison.
2022-08-04 15:50:59 -04:00
Peter Steneteg 8eab76eb84 string(JSON): Adds JSON parsing support to the string command
Adds a set of sub commands to the string command for parsing JSON, the
JSON commands are: GET, TYPE, MEMBER, LENGTH, REMOVE, SET, and EQUAL.

Closes: #19501
2020-09-16 13:55:24 -04:00