Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor typo fixes and styling for README #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.mkdn
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ There are several ways to use the pull (DOM-like) interface of picojson.

The easiest way is to use the two-argument `parse` function.

```
```C++
std::string json = "[ \"hello JSON\" ]";
picojson::value v;
std::string err = picojson::parse(v, json);
if (! err.empty()) {
std:cerr << err << std::endl;
std::cerr << err << std::endl;
}
```

Four-argument `parse` function accepts a pair of iterators, and returns the end position of the input.

```
```C++
const char* json = "{\"a\":1}";
picojson::value v;
std::string err;
Expand All @@ -45,7 +45,7 @@ if (! err.empty()) {
}
```

```
```C++
std::istream_iterator input(std::cin);
picojson::value v;
std::string err;
Expand All @@ -57,7 +57,7 @@ if (! err.empty()) {

It is also possible to use the `>>` operator to parse the input, however this interface is not thread-safe.

```
```C++
picosjon::value v;
std::cin >> v;
std::string err = picojson::get_last_error();
Expand Down Expand Up @@ -145,7 +145,7 @@ const picojson::value::object& obj = v.get&lt;picojson::object&gt;();
for (picojson::value::object::const_iterator i = obj.begin();
i != obj.end();
++i) {
std::cout &lt;&lt; i-&gt;first &lt;&lt; ': ' &lt;&lt; i-&gt;second.to_str() &lt;&lt; std::endl;
std::cout &lt;&lt; i-&gt;first &lt;&lt; ": " &lt;&lt; i-&gt;second.to_str() &lt;&lt; std::endl;
}
</pre>

Expand Down