jaula API Reference version 1.4.0
|
#include <jaula_parse.h>
Data Structures | |
class | Value_Parser |
JSON Value Parser. More... | |
Public Member Functions | |
Parser (void) | |
Constructor. | |
~Parser (void) | |
Destructor. | |
Static Public Member Functions | |
static Value_Complex * | parseStream (std::istream &inpStream, bool comments_allowed=false, bool full_read=true) throw (Exception) |
Parses JSON data from a stream. |
JSON Data Parser.
JAULA::Parser::Parser | ( | void | ) |
Constructor.
JAULA::Parser::~Parser | ( | void | ) |
Destructor.
Value_Complex * JAULA::Parser::parseStream | ( | std::istream & | inpStream, |
bool | comments_allowed = false , |
||
bool | full_read = true |
||
) | throw (Exception) [static] |
Parses JSON data from a stream.
inpStream | stream from where to read the data to parse. |
comments_allowed | flag that if it is true means that the input can contain comments that begin with the hash '#' symbol and ends with eoln (as in bash). If it is false, it means that no comments are allowed in the input and if present will be considered as a syntax error. |
full_read | flag that if it is true means that the parser must analyze the input stream until the end of file is although it already had got a full array or object from it. In this situation, as JSON specification expects just only one array or object per input, any further data that is not a space for the syntax (or a comment if comments are allowed) will launch a syntax error exception. |
Exception | An exception will be thrown as soon as a lexical or syntax error is found analyzing the stream. The result of printing the exception through a stream is a human readable text explaining the error found and an approximation of the error line where occurred. |
References JAULA::Exception::addOrigin(), and JAULA::Lexan::yylex().