brace
Incredibly simple JSON parser in C++
Loading...
Searching...
No Matches
brace::Parser Class Reference

A JSON parsing class for converting JSON strings to JsonValue objects. More...

#include <brace.h>

Public Member Functions

Result< JsonValue, ParseErrorparse (const std::string &json)
 Parses a JSON-formatted string into a JsonValue.
 

Detailed Description

A JSON parsing class for converting JSON strings to JsonValue objects.

This class provides functionality to parse JSON-formatted strings into strongly-typed JsonValue objects. It handles various JSON data types and provides error reporting through the ParseError mechanism.

The parser supports:

  • Parsing JSON objects
  • Parsing JSON arrays
  • Handling null, boolean, number, and string values
  • Error detection and reporting

Member Function Documentation

◆ parse()

Result< JsonValue, ParseError > brace::Parser::parse ( const std::string & json)

Parses a JSON-formatted string into a JsonValue.

Attempts to convert a JSON-formatted string into a structured JsonValue that can represent various JSON data types.

Parameters
jsonThe JSON-formatted string to parse
Returns
A Result object containing either:
  • A successfully parsed JsonValue on success
  • A ParseError describing the parsing failure on error
Note
This method is the primary interface for JSON parsing.

The documentation for this class was generated from the following file: