Open Lighting Architecture: ola::web::PointerTracker Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::web::PointerTracker Class Reference

## Detailed Description

Maintains a Json Pointer (RFC 6901) given a set of Json parse events.

Given the JSON:

{
"foo": {
"bar": 1,
"baz": true
},
"bat": [0, 1, 2]
}

It has the pointers:

- ""
- "/foo"
- "/foo/bar"
- "/foo/baz"
- "/bat"
- "/bat/0"
- "/bat/1"
- "/bat/2"

When parsing this example, the order of method invocation should be:

JsonPointer pointer;
PointerTracker tracker(&pointer);
tracker.OpenObject()
tracker.SetProperty("foo");
tracker.OpenObject();
tracker.SetProperty("bar");
tracker.SetProperty("baz");
tracker.CloseObject();
tracker.SetProperty("bat");
tracker.OpenArray();
tracker.IncrementIndex();
tracker.IncrementIndex();
tracker.IncrementIndex();
tracker.CloseArray();
tracker.CloseObject();
ola::web::JsonPointer
A JSON pointer (RFC 6901) refers to a possible element in a JSON data structure.
Definition JsonPointer.h:66

## Public Member Functions
| PointerTracker (JsonPointer *pointer)
void | OpenObject ()
| Open a new Object Element.
void | SetProperty (const std::string &property)
| Set the property name within an Object element. Note if we're not currently in an object element this has no effect.
void | CloseObject ()
| Close an Object element. Note if we're not currently in an object element this has no effect.
void | OpenArray ()
| Open a new Array Element Note that until IncrementIndex() is called, the array index will be -1. This is so you can call IncrementIndex() on each element.
void | CloseArray ()
| Close an Array Element If we're not currently in an array this doesn't do anything.
void | IncrementIndex ()
| Increment an array index. If we're not current in an array this doesn't do anything.

The documentation for this class was generated from the following files:

- common/web/PointerTracker.h
- common/web/PointerTracker.cpp