From ac9bdc4a79ccd09a052e3de8becaa13e4050f6fa Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 3 Aug 2024 06:57:36 -0700 Subject: [PATCH] update type specimen --- type-specimen.html | 216 ++++++++++++++++++++++++++++++++------------- 1 file changed, 157 insertions(+), 59 deletions(-) diff --git a/type-specimen.html b/type-specimen.html index 2864121..c353149 100644 --- a/type-specimen.html +++ b/type-specimen.html @@ -7,74 +7,163 @@ + +

Overview

-

Boost.URL is a portable C++ library which provides containers and algorithms which model a "URL," more formally - described using the Uniform Resource Identifier (URI) specification (henceforth referred to as rfc3986). A URL is - a compact sequence of characters that identifies an abstract or physical resource. For example, this is a valid - URL: + +

+ Boost.URL is a portable C++ library which provides containers and algorithms + which model a "URL," more formally described using the + Uniform Resource Identifier + (URI) specification + (henceforth referred to as rfc3986). A URL is a compact sequence of characters + that identifies an abstract or physical resource. For example, this is a valid URL:

+
https://www.example.com/path/to/file.txt?userid=1001&pages=3&results=full#page1
+
+ This library understands the grammars related to URLs and provides + functionality to validate, parse, examine, and modify urls, and apply + normalization or resolution algorithms + +

Features

+ +

+ While the library is general purpose, special care has been taken to ensure + that the implementation and data representation are friendly to network + programs which need to handle URLs efficiently and securely, including the + case where the inputs come from untrusted sources. Interfaces are provided + for using error codes instead of exceptions as needed, and most algorithms + have the means to opt-out of dynamic memory allocation. Another feature of + the library is that all modifications leave the URL in a valid state. Code + which uses this library is easy to read, flexible, and performant. +

+ Boost.URL offers these features: +

+

Requirements

-

The library requires a compiler supporting at least C++11.

+ +

+ The library requires a compiler supporting at least C++11. +

+

+ Aliases for standard types, such as + error_code or + string_view, + use their Boost equivalents. +

+

Reference

serializer

A serializer for JSON.

Synopsis

-

Defined in header <boost/json/serializer.hpp>

-
-  class serializer
-  
+

Defined in header <boost/json/serializer.hpp>

+
class serializer
+

Member Functions

@@ -86,19 +175,19 @@ @@ -106,29 +195,30 @@ >
- done + done Returns true if the serialization is complete.
- read + read Read the next buffer of serialized JSON.
- reset + reset Reset the serializer for a new string.

Description

-

This class traverses an instance of a library type and emits serialized JSON text by filling in one or more - caller-provided buffers. To use, declare a variable and call reset with a pointer to the variable you - want to serialize. Then call read over and over until done returns true. +

+ This class traverses an instance of a library type and emits serialized + JSON text by filling in one or more caller-provided buffers. To use, declare + a variable and call + reset with a pointer to the variable you want + to serialize. Then call + read over and over until + done returns true.

Example

This demonstrates how the serializer may be used to print a JSON value to an output stream.

-
-  void print( std::ostream& os, value const & jv)
+    
void print( std::ostream& os, value const & jv)
+{
+  serializer sr;
+  sr.reset( &jv );
+  while ( ! sr.done() )
   {
-      serializer sr;
-      sr.reset( &jv );
-      while ( ! sr.done() )
-      {
-          char buf[ 4000 ];
-          os << sr.read( buf );
-      }
+      char buf[ 4000 ];
+      os << sr.read( buf );
   }
-  
+}
-

Table 1.33. Character Sets

+
Table 1.33. Character Sets
@@ -164,5 +254,13 @@ >Convenience header <boost/json.hpp>

+ +

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+