Skip to content

Commit fe888bf

Browse files
committed
Updates to docs
1 parent c246bcd commit fe888bf

File tree

9 files changed

+19
-98
lines changed

9 files changed

+19
-98
lines changed

Changelog.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,13 @@
468468
</style>
469469
</head>
470470
<body>
471+
<h2>0.99.1</h2>
472+
473+
<ul>
474+
<li>Fix to json_filter class</li>
475+
<li>Fix to readme_examples</li>
476+
</ul>
477+
471478
<h2>0.99</h2>
472479

473480
<ul>

README.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ <h1>jsoncons: a C++ library for json construction</h1>
490490
<li>Supports reading a sequence of JSON texts from a stream</li>
491491
<li>Supports optional escaping of non-ascii UTF-8 octets</li>
492492
<li>Allows extensions to the types accepted by the json class accessors and modifiers</li>
493-
<li>Supports storing "any" values in a json object or array, with specialized serialization</li>
494493
<li>Supports reading (writing) JSON values from (to) CSV files</li>
495494
<li>Passes all tests from <a href="http://www.json.org/JSON_checker/">JSON_checker</a> except <code>fail1.json</code>, which is allowed in <a href="http://www.ietf.org/rfc/rfc7159.txt">RFC7159</a>
496495
</li>
@@ -893,7 +892,7 @@ <h3>wjson construction</h3>
893892
</pre></div>
894893

895894
<div class="highlight highlight-source-c++"><pre> <span class="pl-c">// Serialize the booklist to a file</span>
896-
std::wofstream <span class="pl-en">os</span>(L<span class="pl-s"><span class="pl-pds">"</span>booklist2.json<span class="pl-pds">"</span></span>);
895+
std::wofstream <span class="pl-en">os</span>(<span class="pl-s"><span class="pl-pds">"</span>booklist2.json<span class="pl-pds">"</span></span>);
897896
os &lt;&lt; pretty_print(booklist);</pre></div>
898897

899898
<h3>wjson query</h3>

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ The library has a number of features, which are listed below:
1919
- Supports reading a sequence of JSON texts from a stream
2020
- Supports optional escaping of non-ascii UTF-8 octets
2121
- Allows extensions to the types accepted by the json class accessors and modifiers
22-
- Supports storing "any" values in a json object or array, with specialized serialization
2322
- Supports reading (writing) JSON values from (to) CSV files
2423
- Passes all tests from [JSON_checker](http://www.json.org/JSON_checker/) except `fail1.json`, which is allowed in [RFC7159](http://www.ietf.org/rfc/rfc7159.txt)
2524
- Handles JSON texts of arbitrarily large depth of nesting, a limit can be set if desired
@@ -425,7 +424,7 @@ Result:
425424
```
426425
```c++
427426
// Serialize the booklist to a file
428-
std::wofstream os(L"booklist2.json");
427+
std::wofstream os("booklist2.json");
429428
os << pretty_print(booklist);
430429
```
431430
### wjson query

acknowledgements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
A big thanks to the following individuals for contributing:
22

3-
Andrew Hutko (early code review)
3+
Andrew Hutko (early code review)
44

55
Marc Chevrier (contributed clang port, build files, json is<T> and as<T> methods,
66
and make_array template implementation.)
@@ -23,3 +23,4 @@ Milan Burda for fix for clang build error
2323
Peter Tissen, for reporting and suggesting a fix for get(name,default_val)
2424

2525
Tom Bass for assistance with clang build errors
26+

doc/html/Home.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
</style>
469469
</head>
470470
<body>
471-
<p>All core jsoncons classes and functions are in namespace <code>jsoncons</code>. Extensions are in namespace <code>jsoncons_ext</code>. It is distributed under the <a href="http://www.boost.org/users/license.html">Boost Software License</a>.</p>
471+
<p>All core jsoncons classes and functions are in namespace <code>jsoncons</code>. Extensions are in namespace <code>jsoncons_ext</code>. </p>
472472

473473
<h3>Roadmap</h3>
474474

@@ -486,8 +486,6 @@ <h3>Tutorial</h3>
486486

487487
<p><a href="Type%20Extensibility">Type Extensibility</a></p>
488488

489-
<p><a href="Using%20json%20any">Using json any</a></p>
490-
491489
<p><a href="Transforming%20JSON%20with%20filters">Transforming JSON with filters</a></p>
492490

493491
<h3>Classes</h3>

doc/html/jsoncons.html

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ <h3>Type extensibility</h3>
923923
<span class="pl-k">class</span> <span class="pl-en">json_type_traits</span>
924924
{
925925
<span class="pl-k">public:</span>
926-
<span class="pl-k">static</span> <span class="pl-k">bool</span> <span class="pl-en">is</span>(<span class="pl-k">const</span> JsonT&amp; rhs) noexcept;
926+
<span class="pl-k">static</span> <span class="pl-k">bool</span> <span class="pl-en">is</span>(<span class="pl-k">const</span> JsonT&amp; rhs) <span class="pl-k">noexcept</span>;
927927
<span class="pl-k">static</span> T <span class="pl-en">as</span>(<span class="pl-k">const</span> JsonT&amp; rhs);
928928
<span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">assign</span>(JsonT&amp; lhs, T rhs);
929929
};</pre></div>
@@ -949,50 +949,6 @@ <h3>Type extensibility</h3>
949949
<span class="pl-s"><span class="pl-pds">"</span>observation_dates<span class="pl-pds">"</span></span>:
950950
[<span class="pl-s"><span class="pl-pds">"</span>2013-10-21<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>2013-10-28<span class="pl-pds">"</span></span>]
951951
}</pre></div>
952-
953-
<h3>json any</h3>
954-
955-
<p>jsoncons provides a class <code>json::any</code> that can contain a value of any type as long as that type supports copy construction and <br>
956-
assignment. This allows you to, for example, insert a boost matrix into a <code>json</code> object, and to retrieve it back cast to the appropriate type. You can do so by wrapping it in<br>
957-
a <code>json::any</code> value, like this:</p>
958-
959-
<div class="highlight highlight-source-c++"><pre> #<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>boost/numeric/ublas/matrix.hpp<span class="pl-pds">&gt;</span></span>
960-
961-
<span class="pl-k">using</span> boost::numeric::ublas::matrix;
962-
963-
json val;
964-
965-
matrix&lt;<span class="pl-k">double</span>&gt; <span class="pl-en">A</span>(<span class="pl-c1">2</span>,<span class="pl-c1">2</span>);
966-
<span class="pl-en">A</span>(<span class="pl-c1">0</span>,<span class="pl-c1">0</span>) = 1;
967-
<span class="pl-en">A</span>(<span class="pl-c1">0</span>,<span class="pl-c1">1</span>) = 2;
968-
<span class="pl-en">A</span>(<span class="pl-c1">1</span>,<span class="pl-c1">0</span>) = 3;
969-
<span class="pl-en">A</span>(<span class="pl-c1">1</span>,<span class="pl-c1">1</span>) = 4;
970-
971-
val.set(<span class="pl-s"><span class="pl-pds">"</span>A<span class="pl-pds">"</span></span>,json::any(A));
972-
973-
matrix&lt;<span class="pl-k">double</span>&gt;&amp; B = val[<span class="pl-s"><span class="pl-pds">"</span>A<span class="pl-pds">"</span></span>].any_cast&lt;matrix&lt;<span class="pl-k">double</span>&gt;&gt;();</pre></div>
974-
975-
<p>By default, if you print <code>val</code> on a stream, </p>
976-
977-
<div class="highlight highlight-source-c++"><pre> std::cout &lt;&lt; pretty_print(val) &lt;&lt; std::endl;</pre></div>
978-
979-
<p>the template function</p>
980-
981-
<div class="highlight highlight-source-c++"><pre> <span class="pl-k">template </span>&lt;<span class="pl-k">typename</span> CharT,<span class="pl-k">class</span> <span class="pl-en">T</span>&gt; <span class="pl-k">inline</span>
982-
<span class="pl-k">void</span> <span class="pl-en">serialize</span>(basic_json_output_handler&lt;CharT&gt;&amp; os, <span class="pl-k">const</span> T&amp;)
983-
{
984-
os.<span class="pl-c1">value</span>(<span class="pl-c1">null_type</span>());
985-
}</pre></div>
986-
987-
<p>gets called, and produces a <code>null</code> value for the matrix. You can however introduce a specialization of <code>serialize</code> for <code>boost::numeric::ublas::matrix</code> in the <code>jsoncons</code> namespace, to produce the output </p>
988-
989-
<div class="highlight highlight-source-c++"><pre> {
990-
<span class="pl-s"><span class="pl-pds">"</span>A<span class="pl-pds">"</span></span>:
991-
[
992-
[<span class="pl-c1">1</span>,<span class="pl-c1">2</span>],
993-
[<span class="pl-c1">3</span>,<span class="pl-c1">4</span>]
994-
]
995-
}</pre></div>
996952
</body>
997953
</html>
998954
<!-- This document was created with MarkdownPad, the Markdown editor for Windows (http://markdownpad.com) -->

doc/md/Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
0.99.1
2+
------
3+
4+
- Fix to json_filter class
5+
- Fix to readme_examples
6+
17
0.99
28
----
39

doc/md/Home.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ All core jsoncons classes and functions are in namespace `jsoncons`. Extensions
1616

1717
[Type Extensibility](Type%20Extensibility)
1818

19-
[Using json any](Using%20json%20any)
20-
2119
[Transforming JSON with filters](Transforming%20JSON%20with%20filters)
2220

2321
### Classes

doc/md/Pages/jsoncons.md

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -470,47 +470,4 @@ producing
470470
["2013-10-21","2013-10-28"]
471471
}
472472
```
473-
### json any
474473
475-
jsoncons provides a class `json::any` that can contain a value of any type as long as that type supports copy construction and
476-
assignment. This allows you to, for example, insert a boost matrix into a `json` object, and to retrieve it back cast to the appropriate type. You can do so by wrapping it in
477-
a `json::any` value, like this:
478-
```c++
479-
#include <boost/numeric/ublas/matrix.hpp>
480-
481-
using boost::numeric::ublas::matrix;
482-
483-
json val;
484-
485-
matrix<double> A(2,2);
486-
A(0,0) = 1;
487-
A(0,1) = 2;
488-
A(1,0) = 3;
489-
A(1,1) = 4;
490-
491-
val.set("A",json::any(A));
492-
493-
matrix<double>& B = val["A"].any_cast<matrix<double>>();
494-
```
495-
By default, if you print `val` on a stream,
496-
```c++
497-
std::cout << pretty_print(val) << std::endl;
498-
```
499-
the template function
500-
```c++
501-
template <typename CharT,class T> inline
502-
void serialize(basic_json_output_handler<CharT>& os, const T&)
503-
{
504-
os.value(null_type());
505-
}
506-
```
507-
gets called, and produces a `null` value for the matrix. You can however introduce a specialization of `serialize` for `boost::numeric::ublas::matrix` in the `jsoncons` namespace, to produce the output
508-
```c++
509-
{
510-
"A":
511-
[
512-
[1,2],
513-
[3,4]
514-
]
515-
}
516-
```

0 commit comments

Comments
 (0)