Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Aug 30, 2017
1 parent 32ebfc8 commit 997b112
Show file tree
Hide file tree
Showing 34 changed files with 234 additions and 238 deletions.
2 changes: 2 additions & 0 deletions doc/Classes/csv_parameters.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### jsoncons::csv::csv_parameters

Parameter | Description | Default
------------- | ------------- | -------------
assume_header | Assume first row in file is header, use field names to construct objects | false
Expand Down
16 changes: 7 additions & 9 deletions doc/Classes/csv_reader.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
```c++
jsoncons::csv::csv_reader
```
### jsoncons::csv::csv_reader

The `csv_reader` class is an instantiation of the `basic_csv_reader` class template that uses `char` as the character type. It reads a [CSV file](http://tools.ietf.org/html/rfc4180) and produces JSON parse events.

`csv_reader` is noncopyable and nonmoveable.

### Header
#### Header
```c++
#include <jsoncons_ext/csv/csv_reader.hpp>
```
### Constructors
#### Constructors

csv_reader(std::istream& is,
json_input_handler& handler)
Expand Down Expand Up @@ -46,7 +44,7 @@ JSON events, the specified [parse_error_handler](parse_error_handler.md),
and [csv_parameters](csv_parameters.md).
You must ensure that the input stream, input handler, and error handler exist as long as does `csv_reader`, as `csv_reader` holds pointers to but does not own these objects.

### Member functions
#### Member functions

bool eof() const
Returns `true` when there is no more data to be read from the stream, `false` otherwise
Expand All @@ -61,7 +59,7 @@ Throws [parse_error](parse_error.md) if parsing fails.

### Examples

### Reading a comma delimted file into an array of json values
#### Reading a comma delimted file into an array of json values

#### Comma delimited input file
```
Expand Down Expand Up @@ -99,7 +97,7 @@ std::cout << pretty_print(countries) << std::endl;
["WLF","WALLIS & FUTUNA ISLANDS"]
]
```
### Reading a tab delimted file into an array of json objects
#### Reading a tab delimted file into an array of json objects

#### Tab delimited input file
```
Expand Down Expand Up @@ -214,7 +212,7 @@ std::cout << pretty_print(countries) << std::endl;
```


### Reading a comma delimited file with different mapping options
#### Reading a comma delimited file with different mapping options

#### Input

Expand Down
13 changes: 6 additions & 7 deletions doc/Classes/csv_serializer.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
```c++
jsoncons::csv::csv_serializer
```
### jsoncons::csv::csv_serializer

The `csv_serializer` class is an instantiation of the `basic_csv_serializer` class template that uses `char` as the character type. It implements [json_output_handler](json_output_handler.md) and supports formatting a JSON value as a [CSV file](http://tools.ietf.org/html/rfc4180).

`csv_serializer` is noncopyable and nonmoveable.

### Header
#### Header
```c++
#include <jsoncons_ext/csv/csv_serializer.hpp>
```
### Constructors
#### Constructors

csv_serializer(std::ostream& os)
Constructs a `csv_serializer` that is associated with an output stream
Expand All @@ -22,10 +21,10 @@ Constructs a `csv_serializer` that is associated with an output stream
`os` and [csv_parameters](csv_parameters.md).
You must ensure that the output stream exists as long as does `csv_serializer`, as `json_serializer` holds a pointer to but does not own this object.

### Member functions
#### Member functions


### Destructor
#### Destructor

virtual ~json_serializer()

Expand Down
9 changes: 4 additions & 5 deletions doc/Classes/decode_cbor.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
```c++
jsoncons::cbor::decode_cbor
```
### jsoncons::cbor::decode_cbor

Decodes a [cbor](http://cbor.io/) binary serialization format to a json value.

### Header
#### Header
```c++
#include <jsoncons_ext/cbor/cbor.hpp>

template<class Json>
Json decode_cbor(const std::vector<uint8_t>& v)
```
### See also
#### See also
- [encode_cbor](encode_cbor.md) encodes a json value to the [cbor](http://cbor.io/) binary serialization format.
Expand Down
9 changes: 4 additions & 5 deletions doc/Classes/decode_msgpack.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
```c++
jsoncons::msgpack::decode_msgpack
```
### jsoncons::msgpack::decode_msgpack

Decodes a [MessagePack](http://msgpack.org/index.html) binary serialization format to a json value.

### Header
#### Header
```c++
#include <jsoncons_ext/msgpack/msgpack.hpp>

template<class Json>
Json decode_msgpack(const std::vector<uint8_t>& v)
```
### See also
#### See also
- [encode_msgpack](encode_msgpack.md) encodes a json value to the [MessagePack](http://msgpack.org/index.html) binary serialization format.
Expand Down
14 changes: 8 additions & 6 deletions doc/Classes/default_parse_error_handler.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
jsoncons::default_parse_error_handler
### jsoncons::default_parse_error_handler

typedef basic_default_parse_error_handler<char> default_parse_error_handler
```c++
typedef basic_default_parse_error_handler<char> default_parse_error_handler
```

### Header
#### Header

#include <jsoncons/parse_error_handler.hpp>

### Base class
#### Base class

[parse_error_handler](parse_error_handler.md)

### Static memebr functions
#### Static memebr functions

static parse_error_handler& instance()
Returns a singleton instance of a `default_parse_error_handler`

### Private virtual implementation methods
##### Private virtual implementation methods

bool do_error(std::error_code ec,
const parsing_context& context) override
Expand Down
13 changes: 6 additions & 7 deletions doc/Classes/dump.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
```c++
jsoncons::dump
```
### jsoncons::dump

Serialize C++ object to a JSON formatted stream, governed by `json_stream_traits`

### Header
#### Header
```c++
#include <jsoncons/json_stream_traits.hpp>

Expand Down Expand Up @@ -32,7 +31,7 @@ void dump(const T& val, const basic_serialization_options<CharT>& options,
(2) Applies `json_stream_traits` to serialize `val` to JSON output stream, but does not call begin_json() and `end_json()`.
### Parameters
#### Parameters
<table>
<tr>
Expand All @@ -57,11 +56,11 @@ void dump(const T& val, const basic_serialization_options<CharT>& options,
</tr>
</table>
### Return value
#### Return value
None
### See also
#### See also
- [json_output_handler](json_output_handler.md)
- [serialization_options](serialization_options.md)
Expand Down
15 changes: 7 additions & 8 deletions doc/Classes/encode_cbor.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
```c++
jsoncons::cbor::encode_cbor
```
### jsoncons::cbor::encode_cbor

Encodes a json value to the [cbor](http://cbor.io/) binary serialization format.

### Header
#### Header
```c++
#include <jsoncons_ext/cbor/cbor.hpp>

template<class Json>
std::vector<uint8_t> encode_cbor(const Json& jval)
```
#### See also
- [decode_cbor](decode_cbor) decodes a [cbor](http://cbor.io/) binary serialization format to a json value.
### Examples
## cbor example
Expand Down Expand Up @@ -87,8 +90,4 @@ Output:
}
```

### See also

- [decode_cbor](decode_cbor) decodes a [cbor](http://cbor.io/) binary serialization format to a json value.


17 changes: 8 additions & 9 deletions doc/Classes/encode_msgpack.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
```c++
jsoncons::msgpack::encode_msgpack
```
### jsoncons::msgpack::encode_msgpack

Encodes a json value to the [MessagePack](http://msgpack.org/index.html) binary serialization format.

### Header
#### Header
```c++
#include <jsoncons_ext/msgpack/msgpack.hpp>

template<class Json>
std::vector<uint8_t> encode_msgpack(const Json& jval)
```
#### See also
- [decode_msgpack](decode_msgpack) decodes a [MessagePack](http://msgpack.org/index.html) binary serialization format to a json value.
### Examples
## MessagePack example
#### MessagePack example
```c++
#include <jsoncons/json.hpp>
Expand Down Expand Up @@ -87,8 +90,4 @@ Output:
}
```

### See also

- [decode_msgpack](decode_msgpack) decodes a [MessagePack](http://msgpack.org/index.html) binary serialization format to a json value.


Loading

0 comments on commit 997b112

Please sign in to comment.