summaryrefslogtreecommitdiff
path: root/jsonpath.h
AgeCommit message (Collapse)Author
2010-08-10Added explicit NULL and '\0' checks, and documented more functions/structures.Joey Adams
2010-08-05Renamed json_node to JSON in the C code.Joey Adams
2010-08-05Added license comments to source files and ran pgindentJoey Adams
2010-07-23Ran pg_indent and made a few purely cosmetic changes (before running ↵Joey Adams
pg_indent again).
2010-07-23* JSONPath index subscript no longer extracts chars from strings.Joey Adams
* char() method added to JSONPath for extracting chars from strings. Although index subscripts (those using an integer) extract characters from strings in Stefan Goessner's JSONPath, and although it works that way in JavaScript, I believe it is rather illogical and unexpected in the context of JSONPath, and a poor use of the [] real estate. Because extracting characters from strings can still be useful, I have added a char() method for this. I implemented it now to prevent the supporting code for character extraction from wasting away.
2010-07-22* Added json_set(json, json_path text, json) function.Joey Adams
* Reworked json_node::orig so it can handle replacing the key or value without altering surrounding formatting. * json_encode (C function) is now recursive (its stack usage depends on the depth of input). This was done because json_encode cannot rely on nodes' ->parent fields being trustworthy, as json_replace_value assigns JSON nodes by reference.
2010-07-14Refactored jsonpath a bit by introducing JPRef.Joey Adams
JPRef is a structure representing an item matched by jp_match. Before, plain old json_node was used, which couldn't distinguish between mutable references (actual JSON nodes from the original input) and immutable references (e.g. characters in a string). Yes, characters in a string are regarded as immutable because: * That's how it is in JavaScript. * It's easier to implement.
2010-06-14Implemented/tested parser for basic JSONPath(ish) patterns.Joey Adams