Skip to content

Commit

Permalink
- json: documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
oknenavin committed Jul 22, 2024
1 parent 8ff6cd0 commit 8a49402
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/cxon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,13 @@ the behavior of the library or to change the `JSON` language:
namespace cxon { namespace json { // format traits
struct format_traits : cio::format_traits {
// enables/disables UTF-8 string validation
// read: check UTF-8 encoding
static constexpr bool validate_string_encoding = true;
// check for unescaped control characters
// read: check for unescaped control characters
static constexpr bool validate_string_escapes = true;
// escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR (ECMA-262, 12.3 Line Terminators)
// write: escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR (ECMA-262, 12.3 Line Terminators)
static constexpr bool produce_strict_javascript = false;
// read/write: assume that strings to be read/written do not contain escape characters
Expand Down Expand Up @@ -476,7 +476,7 @@ namespace cxon { namespace json { // format traits
}}
```

The correctness parameters can also be set with macros:
The correctness parameters can also be set with preprocessor macros:

Parameter | Macro
--------------------------|------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/cxon/lang/json/json.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace cxon { namespace json { // format traits
using write_error = json::write_error;

static constexpr bool validate_string_encoding = CXON_JSON_VALIDATE_STRING_ENCODING; // read: validate input strings (utf-8)
static constexpr bool validate_string_escapes = CXON_JSON_VALIDATE_STRING_ESCAPES; // read: validate input strings (unescaped control characters)
static constexpr bool validate_string_escapes = CXON_JSON_VALIDATE_STRING_ESCAPES; // read: validate input strings for unescaped control characters

static constexpr bool produce_strict_javascript = CXON_JSON_PRODUCE_STRICT_JAVASCRIPT; // write: escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR (ECMA-262, 12.3 Line Terminators)

Expand Down
2 changes: 1 addition & 1 deletion test/src/json/space/rapidjson.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

int main() {
rapidjson::Document d;
auto constexpr opt = rapidjson::kParseValidateEncodingFlag|rapidjson::kParseFullPrecisionFlag;
auto constexpr opt = rapidjson::kParseValidateEncodingFlag|rapidjson::kParseFullPrecisionFlag;
rapidjson::ParseResult r = d.Parse<opt>("[42]");
return !(r && d.IsArray() && d.GetArray().Size() == 1 && d.GetArray()[0] == 42);
}

0 comments on commit 8a49402

Please sign in to comment.