FIMS  v0.8.0
Loading...
Searching...
No Matches
fims::JsonParser Class Reference

#include <fims_json.hpp>

Public Member Functions

JsonValue Parse (const std::string &json)
 
void WriteToFile (const std::string &filename, JsonValue jsonValue)
 
void Show (JsonValue jsonValue)
 

Static Public Member Functions

static std::string removeWhitespace (const std::string &input)
 
static std::string PrettyFormatJSON (const std::string &json)
 Formats a JSON string.
 

Detailed Description

Parses JSON strings and generates JSON values.

Member Function Documentation

◆ Parse()

JsonValue fims::JsonParser::Parse ( const std::string &  json)

Parse a JSON string and return the corresponding JSON value.

Parse a JSON string and return the corresponding JSON value.

Parameters
jsonThe JSON string to parse.
Returns
The parsed JSON value.

◆ PrettyFormatJSON()

static std::string fims::JsonParser::PrettyFormatJSON ( const std::string &  json)
inlinestatic

Formats a JSON string.

Parameters
json
Returns

◆ removeWhitespace()

static std::string fims::JsonParser::removeWhitespace ( const std::string &  input)
inlinestatic

Remove whitespace in JSON.

◆ Show()

void fims::JsonParser::Show ( JsonValue  jsonValue)

Display a JSON value to the standard output.

Display a JSON value to the standard output.

Parameters
jsonValueThe JSON value to display.

◆ WriteToFile()

void fims::JsonParser::WriteToFile ( const std::string &  filename,
JsonValue  jsonValue 
)

Write a JSON value to a file.

Write a JSON value to an output file.

Parameters
filenameThe name of the output file.
jsonValueThe JSON value to write.

Call a private helper function to write JSON values recursively


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