You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.html
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -490,7 +490,6 @@ <h1>jsoncons: a C++ library for json construction</h1>
490
490
<li>Supports reading a sequence of JSON texts from a stream</li>
491
491
<li>Supports optional escaping of non-ascii UTF-8 octets</li>
492
492
<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>
494
493
<li>Supports reading (writing) JSON values from (to) CSV files</li>
495
494
<li>Passes all tests from <ahref="http://www.json.org/JSON_checker/">JSON_checker</a> except <code>fail1.json</code>, which is allowed in <ahref="http://www.ietf.org/rfc/rfc7159.txt">RFC7159</a>
496
495
</li>
@@ -893,7 +892,7 @@ <h3>wjson construction</h3>
893
892
</pre></div>
894
893
895
894
<divclass="highlight highlight-source-c++"><pre><spanclass="pl-c">// Serialize the booklist to a file</span>
Copy file name to clipboardExpand all lines: README.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,6 @@ The library has a number of features, which are listed below:
19
19
- Supports reading a sequence of JSON texts from a stream
20
20
- Supports optional escaping of non-ascii UTF-8 octets
21
21
- 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
23
22
- Supports reading (writing) JSON values from (to) CSV files
24
23
- 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)
25
24
- Handles JSON texts of arbitrarily large depth of nesting, a limit can be set if desired
Copy file name to clipboardExpand all lines: doc/html/Home.html
+1-3Lines changed: 1 addition & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -468,7 +468,7 @@
468
468
</style>
469
469
</head>
470
470
<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 <ahref="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>
<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>
matrix<<spanclass="pl-k">double</span>>& B = val[<spanclass="pl-s"><spanclass="pl-pds">"</span>A<spanclass="pl-pds">"</span></span>].any_cast<matrix<<spanclass="pl-k">double</span>>>();</pre></div>
974
-
975
-
<p>By default, if you print <code>val</code> on a stream, </p>
<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>
Copy file name to clipboardExpand all lines: doc/md/Pages/jsoncons.md
-43Lines changed: 0 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -470,47 +470,4 @@ producing
470
470
["2013-10-21","2013-10-28"]
471
471
}
472
472
```
473
-
### json any
474
473
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>>();
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
0 commit comments