Skip to content

Commit f55076c

Browse files
committed
Add type specimen
1 parent 9b1b952 commit f55076c

File tree

1 file changed

+168
-0
lines changed

1 file changed

+168
-0
lines changed

type-specimen.html

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Type Specimen</title>
7+
<link rel="preconnect" href="https://fonts.googleapis.com" />
8+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9+
<link
10+
href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wdth,wght@0,87.5,100..900;1,87.5,100..900&display=swap"
11+
rel="stylesheet"
12+
/>
13+
<style>
14+
:root {
15+
--color-cyan: rgb(0, 90, 156);
16+
}
17+
body {
18+
font-family: "Noto Sans";
19+
font-variation-settings: "wdth" 87.5;
20+
}
21+
code {
22+
font-family: "Noto Sans Condensed", monospace;
23+
font-weight: 500;
24+
color: var(--color-cyan);
25+
}
26+
27+
h1 {
28+
font-weight: 600;
29+
}
30+
h2 {
31+
font-weight: 600;
32+
}
33+
h3 {
34+
font-weight: 500;
35+
}
36+
h4 {
37+
font-weight: 600;
38+
}
39+
h5 {
40+
font-weight: 600;
41+
}
42+
h6 {
43+
font-weight: 600;
44+
}
45+
46+
a {
47+
color: var(--color-cyan);
48+
text-decoration: none;
49+
}
50+
</style>
51+
</head>
52+
53+
<body>
54+
<h1>Overview</h1>
55+
<p
56+
>Boost.URL is a portable C++ library which provides containers and algorithms which model a "URL," more formally
57+
described using the Uniform Resource Identifier (URI) specification (henceforth referred to as rfc3986). A URL is
58+
a compact sequence of characters that identifies an abstract or physical resource. For example, this is a valid
59+
URL:
60+
</p>
61+
62+
<h2>Requirements</h2>
63+
<p>The library requires a compiler supporting at least C++11.</p>
64+
<h2>Reference</h2>
65+
66+
<h3>serializer</h3>
67+
<p>A serializer for JSON.</p>
68+
69+
<h4>Synopsis</h4>
70+
<p
71+
>Defined in header &lt;<code><a href="">boost/json/serializer.hpp</a></code
72+
>&gt;</p
73+
>
74+
<pre>
75+
class serializer
76+
</pre
77+
>
78+
<h4>Member Functions</h4>
79+
<table>
80+
<thead>
81+
<tr>
82+
<th>Name</th>
83+
<th>Description</th>
84+
</tr>
85+
</thead>
86+
<tbody>
87+
<tr>
88+
<td>
89+
<a href="#">done</a>
90+
</td>
91+
<td>Returns <code>true</code> if the serialization is complete.</td>
92+
</tr>
93+
<tr>
94+
<td>
95+
<a href="#">read</a>
96+
</td>
97+
<td>Read the next buffer of serialized JSON. </td>
98+
</tr>
99+
<tr>
100+
<td>
101+
<a href="#">reset</a>
102+
</td>
103+
<td>Reset the serializer for a new string.</td>
104+
</tr>
105+
<tr> </tr></tbody
106+
></table>
107+
108+
<h4>Description</h4>
109+
<p
110+
>This class traverses an instance of a library type and emits serialized JSON text by filling in one or more
111+
caller-provided buffers. To use, declare a variable and call <code>reset</code> with a pointer to the variable you
112+
want to serialize. Then call <code>read</code> over and over until <code>done</code> returns <code>true</code>.
113+
</p>
114+
115+
<h4>Example</h4>
116+
<p>This demonstrates how the serializer may be used to print a JSON value to an output stream.</p>
117+
<pre>
118+
void print( std::ostream& os, value const & jv)
119+
{
120+
serializer sr;
121+
sr.reset( &jv );
122+
while ( ! sr.done() )
123+
{
124+
char buf[ 4000 ];
125+
os << sr.read( buf );
126+
}
127+
}
128+
</pre
129+
>
130+
131+
<p>Table 1.33. Character Sets</p>
132+
<table>
133+
<thead>
134+
<tr>
135+
<th>Name</th>
136+
<th>Description</th>
137+
</tr>
138+
</thead>
139+
<tbody>
140+
<tr>
141+
<td>
142+
<a href="#">alnum_chars</a>
143+
</td>
144+
<td>Contains the uppercase and lowercase letters, and digits.</td>
145+
</tr>
146+
<tr>
147+
<td>
148+
<a href="#">alpha_chars</a>
149+
</td>
150+
<td>Contains the uppercase and lowercase letters.</td>
151+
</tr>
152+
<tr>
153+
<td>
154+
<a href="#">digit_chars</a>
155+
</td>
156+
<td>Contains the decimal digit characters.</td>
157+
</tr>
158+
<tr> </tr></tbody
159+
></table>
160+
161+
<h4>Thread Safety</h4>
162+
<p>The same instance may not be accessed concurrently.</p>
163+
<p
164+
>Convenience header &lt;<code><a href="">boost/json.hpp</a></code
165+
>&gt;</p
166+
>
167+
</body>
168+
</html>

0 commit comments

Comments
 (0)