Poco::RemotingNG::REST

class JSONParser

File Information

Library: RemotingNG/REST
Package: JSONParser
Header: Poco/RemotingNG/REST/JSONParser.h

Description

A simple parser for JSON.

Member Summary

Member Functions: getMaxDepth, isEOF, isWhitespace, parse, parseArray, parseObject, parseScalar, parseString, parseUnicode, parseValue, setMaxDepth, skipWhitespace

Constructors

JSONParser

JSONParser(
    std::istream & istr
);

Creates a JSONParser for parsing the given stream.

Destructor

~JSONParser

~JSONParser();

Destroys the JSONParser.

Member Functions

getMaxDepth inline

std::size_t getMaxDepth() const;

Returns the maximum allowed depth of the JSON document.

parse

JSValue::Ptr parse();

Reads a JSValue from the stream.

setMaxDepth inline

void setMaxDepth(
    std::size_t maxDepth
);

Sets the maximum allowed depth of the JSON document.

isEOF protected static inline

static bool isEOF(
    int ch
);

isWhitespace protected static inline

static bool isWhitespace(
    int ch
);

parseArray protected

int parseArray(
    int ch,
    JSValue::Ptr & pArray
);

parseObject protected

int parseObject(
    int ch,
    JSValue::Ptr & pObject
);

parseScalar protected

int parseScalar(
    int ch,
    JSValue::Ptr & pScalar
);

parseString protected

int parseString(
    int ch,
    std::string & str
);

parseUnicode protected

int parseUnicode(
    int ch,
    std::string & str
);

parseValue protected

int parseValue(
    int ch,
    JSValue::Ptr & pValue
);

skipWhitespace protected

int skipWhitespace(
    int ch
);

Variables

MAX_DEPTH static

constexpr static std::size_t MAX_DEPTH = 50;