diff --git a/doc/mkdocs/docs/api/basic_json/basic_json.md b/doc/mkdocs/docs/api/basic_json/basic_json.md index 2e93ce40a..bbed0e4ed 100644 --- a/doc/mkdocs/docs/api/basic_json/basic_json.md +++ b/doc/mkdocs/docs/api/basic_json/basic_json.md @@ -1,38 +1,38 @@ # basic_json::basic_json ```cpp -// 1 +// (1) basic_json(const value_t v); -// 2 +// (2) basic_json(std::nullptr_t = nullptr) noexcept; -// 3 +// (3) template basic_json(CompatibleType&& val) noexcept(noexcept( JSONSerializer::to_json(std::declval(), std::forward(val)))); -// 4 +// (4) template basic_json(const BasicJsonType& val); -// 5 +// (5) basic_json(initializer_list_t init, bool type_deduction = true, value_t manual_type = value_t::array); -// 6 +// (6) basic_json(size_type cnt, const basic_json& val); -// 7 +// (7) basic_json(iterator first, iterator last); basic_json(const_iterator first, const_iterator last); -// 8 +// (8) basic_json(const basic_json& other); -// 9 +// (9) basic_json(basic_json&& other) noexcept; ``` diff --git a/doc/mkdocs/docs/api/basic_json/contains.md b/doc/mkdocs/docs/api/basic_json/contains.md index 2c9ebaac0..f49c73a8f 100644 --- a/doc/mkdocs/docs/api/basic_json/contains.md +++ b/doc/mkdocs/docs/api/basic_json/contains.md @@ -6,7 +6,7 @@ template bool contains(KeyT && key) const; // (2) -bool contains(const json_pointer& ptr) const +bool contains(const json_pointer& ptr) const; ``` 1. Check whether an element exists in a JSON object with key equivalent to `key`. If the element is not found or the diff --git a/doc/mkdocs/docs/api/basic_json/find.md b/doc/mkdocs/docs/api/basic_json/find.md index 7e2e48fc4..6c233b280 100644 --- a/doc/mkdocs/docs/api/basic_json/find.md +++ b/doc/mkdocs/docs/api/basic_json/find.md @@ -5,7 +5,7 @@ template iterator find(KeyT&& key); template -const_iterator find(KeyT&& key) const +const_iterator find(KeyT&& key) const; ``` Finds an element in a JSON object with key equivalent to `key`. If the element is not found or the JSON value is not an diff --git a/doc/mkdocs/docs/api/basic_json/get_to.md b/doc/mkdocs/docs/api/basic_json/get_to.md index df2c3ad86..2d19b85cb 100644 --- a/doc/mkdocs/docs/api/basic_json/get_to.md +++ b/doc/mkdocs/docs/api/basic_json/get_to.md @@ -4,7 +4,7 @@ template ValueType& get_to(ValueType& v) const noexcept( noexcept(JSONSerializer::from_json( - std::declval(), v))) + std::declval(), v))); ``` Explicit type conversion between the JSON value and a compatible value. The value is filled into the input parameter by diff --git a/doc/mkdocs/docs/api/basic_json/object_comparator_t.md b/doc/mkdocs/docs/api/basic_json/object_comparator_t.md index 8fb8656c8..477479619 100644 --- a/doc/mkdocs/docs/api/basic_json/object_comparator_t.md +++ b/doc/mkdocs/docs/api/basic_json/object_comparator_t.md @@ -1,11 +1,9 @@ # basic_json::object_comparator_t ```cpp -// until C++14 -using object_comparator_t = std::less; +using object_comparator_t = std::less; // until C++14 -// since C++14 -using object_comparator_t = std::less<>; +using object_comparator_t = std::less<>; // since C++14 ``` The comparator used in [`object_t`](object_t.md). diff --git a/doc/mkdocs/docs/api/basic_json/operator_gtgt.md b/doc/mkdocs/docs/api/basic_json/operator_gtgt.md index 8ef3ca187..879272e62 100644 --- a/doc/mkdocs/docs/api/basic_json/operator_gtgt.md +++ b/doc/mkdocs/docs/api/basic_json/operator_gtgt.md @@ -1,7 +1,7 @@ # operator>>(basic_json) ```cpp -std::istream& operator>>(std::istream& i, basic_json& j) +std::istream& operator>>(std::istream& i, basic_json& j); ``` Deserializes an input stream to a JSON value. diff --git a/doc/mkdocs/docs/api/basic_json/operator_literal_json.md b/doc/mkdocs/docs/api/basic_json/operator_literal_json.md index 8c96067b9..7db3fb107 100644 --- a/doc/mkdocs/docs/api/basic_json/operator_literal_json.md +++ b/doc/mkdocs/docs/api/basic_json/operator_literal_json.md @@ -1,7 +1,7 @@ # basic_json::operator""_json ```cpp -json operator "" _json(const char* s, std::size_t n) +json operator "" _json(const char* s, std::size_t n); ``` This operator implements a user-defined string literal for JSON objects. It can be used by adding `#!cpp _json` to a diff --git a/doc/mkdocs/docs/api/basic_json/operator_literal_json_pointer.md b/doc/mkdocs/docs/api/basic_json/operator_literal_json_pointer.md index 0316b7c61..5ff9e0a9b 100644 --- a/doc/mkdocs/docs/api/basic_json/operator_literal_json_pointer.md +++ b/doc/mkdocs/docs/api/basic_json/operator_literal_json_pointer.md @@ -1,7 +1,7 @@ # basic_json::operator""_json_pointer ```cpp -json_pointer operator "" _json_pointer(const char* s, std::size_t n) +json_pointer operator "" _json_pointer(const char* s, std::size_t n); ``` This operator implements a user-defined string literal for JSON Pointers. It can be used by adding `#!cpp _json_pointer` diff --git a/doc/mkdocs/docs/api/basic_json/operator_lt.md b/doc/mkdocs/docs/api/basic_json/operator_lt.md index f9ac6c778..ae9bb6f3f 100644 --- a/doc/mkdocs/docs/api/basic_json/operator_lt.md +++ b/doc/mkdocs/docs/api/basic_json/operator_lt.md @@ -1,7 +1,7 @@ # basic_json::operator< ```cpp -bool operator<(const_reference lhs, const_reference rhs) noexcept, +bool operator<(const_reference lhs, const_reference rhs) noexcept; template bool operator<(const_reference lhs, const ScalarType rhs) noexcept; diff --git a/doc/mkdocs/docs/api/basic_json/operator_ltlt.md b/doc/mkdocs/docs/api/basic_json/operator_ltlt.md index f0c05fdf7..d62aaaf34 100644 --- a/doc/mkdocs/docs/api/basic_json/operator_ltlt.md +++ b/doc/mkdocs/docs/api/basic_json/operator_ltlt.md @@ -1,7 +1,7 @@ # operator<<(basic_json) ```cpp -std::ostream& operator<<(std::ostream& o, const basic_json& j) +std::ostream& operator<<(std::ostream& o, const basic_json& j); ``` Serialize the given JSON value `j` to the output stream `o`. The JSON value will be serialized using the diff --git a/doc/mkdocs/docs/api/basic_json/to_string.md b/doc/mkdocs/docs/api/basic_json/to_string.md index bdf42c3a9..9a9deabda 100644 --- a/doc/mkdocs/docs/api/basic_json/to_string.md +++ b/doc/mkdocs/docs/api/basic_json/to_string.md @@ -2,7 +2,7 @@ ```cpp template -std::string to_string(const BasicJsonType& j) +std::string to_string(const BasicJsonType& j); ``` This function implements a user-defined to_string for JSON objects. diff --git a/doc/mkdocs/docs/api/basic_json/~basic_json.md b/doc/mkdocs/docs/api/basic_json/~basic_json.md index b089b0d79..9ffea2a84 100644 --- a/doc/mkdocs/docs/api/basic_json/~basic_json.md +++ b/doc/mkdocs/docs/api/basic_json/~basic_json.md @@ -1,7 +1,7 @@ # basic_json::~basic_json ```cpp -~basic_json() noexcept +~basic_json() noexcept; ``` Destroys the JSON value and frees all allocated memory. diff --git a/doc/mkdocs/docs/api/byte_container_with_subtype/index.md b/doc/mkdocs/docs/api/byte_container_with_subtype/index.md index 3db24ae63..f1f18482b 100644 --- a/doc/mkdocs/docs/api/byte_container_with_subtype/index.md +++ b/doc/mkdocs/docs/api/byte_container_with_subtype/index.md @@ -2,7 +2,7 @@ ```cpp template -class byte_container_with_subtype : public BinaryType +class byte_container_with_subtype : public BinaryType; ``` This type extends the template parameter `BinaryType` provided to [`basic_json`](../basic_json/index.md) with a subtype diff --git a/doc/mkdocs/docs/api/byte_container_with_subtype/set_subtype.md b/doc/mkdocs/docs/api/byte_container_with_subtype/set_subtype.md index 7c5360446..7b78aea99 100644 --- a/doc/mkdocs/docs/api/byte_container_with_subtype/set_subtype.md +++ b/doc/mkdocs/docs/api/byte_container_with_subtype/set_subtype.md @@ -1,7 +1,7 @@ # byte_container_with_subtype::set_subtype ```cpp -void set_subtype(subtype_type subtype) noexcept +void set_subtype(subtype_type subtype) noexcept; ``` Sets the binary subtype of the value, also flags a binary JSON value as having a subtype, which has implications for diff --git a/doc/mkdocs/docs/api/json_sax/number_float.md b/doc/mkdocs/docs/api/json_sax/number_float.md index 5f7f4ec6b..39304d3aa 100644 --- a/doc/mkdocs/docs/api/json_sax/number_float.md +++ b/doc/mkdocs/docs/api/json_sax/number_float.md @@ -11,6 +11,9 @@ A floating-point number was read. `val` (in) : floating-point value +`s` (in) +: string representation of the original input + ## Return value Whether parsing should proceed. diff --git a/doc/mkdocs/scripts/check_strcuture.py b/doc/mkdocs/scripts/check_strcuture.py index 50a79e8eb..83f6235fa 100644 --- a/doc/mkdocs/scripts/check_strcuture.py +++ b/doc/mkdocs/scripts/check_strcuture.py @@ -36,10 +36,12 @@ def check_structure(): with open(file) as file_content: header_idx = -1 existing_headers = [] + in_initial_code_example = False for lineno, line in enumerate(file_content.readlines()): line = line.strip() + # check if headers are correct if line.startswith('## '): header = line.strip('## ') existing_headers.append(header) @@ -52,6 +54,17 @@ def check_structure(): else: print(f'{file}:{lineno+1}: Error: header "{header}" is not part of the expected headers!') + # code example + if line == '```cpp' and header_idx == -1: + in_initial_code_example = True + + if in_initial_code_example and line.startswith('//'): + if any(map(str.isdigit, line)) and '(' not in line: + print(f'{file}:{lineno+1}: Number should be in parentheses: {line}') + + if line == '```' and in_initial_code_example: + in_initial_code_example = False + for required_header in required_headers: if required_header not in existing_headers: print(f'{file}:{lineno+1}: Error: required header "{required_header}" was not found!')