summaryrefslogtreecommitdiff
path: root/json-glib/tests/reader-test.c
Commit message (Collapse)AuthorAgeFilesLines
* build: Rename test binariesEmmanuele Bassi2011-06-191-134/+0
| | | | It's pointless to add the '-test' suffix to files under the tests/ directory.
* reader: Add accessor for the member nameEmmanuele Bassi2011-02-061-0/+1
| | | | This should allow easy access to the member name during iteration.
* reader: Allow using read_element() on objectsEmmanuele Bassi2011-02-061-0/+6
| | | | | | | | | | | | | | | If we assume that a JSON object is just an array with a named mapping then the JsonReader API should be able to descend into objects using the same API used for arrays. This obviously is less useful than it sounds if we take a very strict interpretation of JSON objects as unordered string-to-value mappings; as the ordering is not guaranteed to be stable, parsers would be fairly weak against various JSON definitions. If the JSON format parsed is guaranteed to be stable then an integer offset might be an easy (albeit slightly less performant) way to access data.
* reader: Add list_members() methodEmmanuele Bassi2011-02-041-0/+19
| | | | | Allow retrieving a list of member names from the current cursor position of the JsonReader. It's useful if you're trying to inspect a JSON tree.
* reader: Add :root constructor propertyEmmanuele Bassi2010-08-141-2/+2
| | | | | A JsonReader is useless without a root JsonNode to start walking the tree from.
* reader: Do not wrap JsonParserEmmanuele Bassi2010-08-121-2/+9
| | | | | | | Since JsonParser has far more methods for parsing a JSON stream we should just make JsonReader an API for reading an already parsed JSON tree - in the same way that JsonBuilder does not generate the stringified version of the JSON tree it builds.
* reader: Mirror the JsonBuilder API value accessorsEmmanuele Bassi2010-08-121-4/+4
| | | | We should strive to make JsonBuilder and JsonReader similar in API.
* Add JsonReaderEmmanuele Bassi2010-08-121-0/+101
JsonReader is a simple, cursor-based API for parsing a JSON DOM. It is similar, in spirit, to the XmlReader API provided by various platforms and XML parsing libraries.