Skip to content

Commit

Permalink
Minor grammar corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed May 4, 2015
1 parent 5bec8b9 commit a3e5fcf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/pointer.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Pointer("/stars").Set(d, 10);

// { "project" : "RapidJSON", "stars" : 10 }

// Access DOM by Get(). It return nullptr if the value is not exist.
// Access DOM by Get(). It return nullptr if the value does not exist.
if (Value* stars = Pointer("/stars").Get(d))
stars->SetInt(stars->GetInt() + 1);

Expand Down Expand Up @@ -98,7 +98,7 @@ The conventions are shown here for comparison:

# Resolving Pointer {#ResolvingPointer}

`Pointer::Get()` or `GetValueByPointer()` function does not modify the DOM. If the tokens cannot match a value in the DOM, it returns `nullptr`. User can use this to see whether a value is exists.
`Pointer::Get()` or `GetValueByPointer()` function does not modify the DOM. If the tokens cannot match a value in the DOM, it returns `nullptr`. User can use this to check whether a value exists.

Note that, numerical tokens can represent an array index or member name. The resolving process will match the values according to the types of value.

Expand All @@ -124,7 +124,7 @@ SetValueByPointer(d, "1/a", 789); // { "0" : 123, "1" : { "a" : 789 } }
## Resolving Minus Sign Token
Besides, [RFC6901] defines a special token `-` (single minus sign), which means the pass-the-end value of an array. `Get()` only treats this token as a member name '"-"'. Yet the other functions can resolve this for array, equivalent to calling `Value::PushBack()` to the array.
Besides, [RFC6901] defines a special token `-` (single minus sign), which represents the pass-the-end element of an array. `Get()` only treats this token as a member name '"-"'. Yet the other functions can resolve this for array, equivalent to calling `Value::PushBack()` to the array.
~~~cpp
Document d;
Expand Down

0 comments on commit a3e5fcf

Please sign in to comment.