21#ifndef COMMON_WEB_SCHEMAPARSER_H_
22#define COMMON_WEB_SCHEMAPARSER_H_
29#include "common/web/PointerTracker.h"
30#include "common/web/SchemaErrorLogger.h"
31#include "common/web/SchemaParseContext.h"
64 void String(
const std::string &value);
65 void Number(uint32_t value);
66 void Number(int32_t value);
67 void Number(uint64_t value);
68 void Number(int64_t value);
71 void Bool(
bool value);
78 void SetError(
const std::string &error);
89 std::string
Error()
const;
106 std::auto_ptr<SchemaDefinitions> m_schema_defs;
107 std::auto_ptr<SchemaParseContext> m_root_context;
109 std::auto_ptr<ValidatorInterface> m_root_validator;
111 std::stack<class SchemaParseContextInterface*> m_context_stack;
116 template <
typename T>
117 void HandleNumber(T t);
The class used to parse JSON data.
An implementation of Json Pointers (RFC 6901).
The interface used to handle tokens during JSON parsing.
Definition JsonLexer.h:71
A JSON pointer (RFC 6901) refers to a possible element in a JSON data structure.
Definition JsonPointer.h:66
Maintains a Json Pointer (RFC 6901) given a set of Json parse events.
Definition PointerTracker.h:77
Definition JsonSchema.h:960
The SchemaErrorLogger captures errors while parsing the schema.
Definition SchemaErrorLogger.h:41
Build the tree of validators and a SchemaDefinitions object from a JSON Schema.
Definition SchemaParser.h:49
void SetError(const std::string &error)
Can be called at any time to indicate an error with the input data.
Definition SchemaParser.cpp:225
void Bool(bool value)
Called when a bool is encountered.
Definition SchemaParser.cpp:96
void OpenArray()
Called when an array starts.
Definition SchemaParser.cpp:134
void Number(uint32_t value)
Called when a uint32_t is encountered.
Definition SchemaParser.cpp:70
void End()
Called when parsing completes.
Definition SchemaParser.cpp:49
void CloseObject()
Called when an object completes.
Definition SchemaParser.cpp:206
void Null()
Called when a null token is encountered.
Definition SchemaParser.cpp:115
void OpenObject()
Called when an object starts.
Definition SchemaParser.cpp:170
void ObjectKey(const std::string &key)
Called when a new key is encountered.
Definition SchemaParser.cpp:192
void String(const std::string &value)
Called when a string is encountered.
Definition SchemaParser.cpp:51
SchemaDefinitions * ClaimSchemaDefs()
Claim the SchemaDefinitions that were created by parsing the schema.
Definition SchemaParser.cpp:241
ValidatorInterface * ClaimRootValidator()
Claim the RootValidator that was created by parsing the schema.
Definition SchemaParser.cpp:237
void Begin()
Called when parsing begins.
Definition SchemaParser.cpp:41
std::string Error() const
Get the error message.
Definition SchemaParser.cpp:233
void CloseArray()
Called when an array completes.
Definition SchemaParser.cpp:155
bool IsValidSchema()
Check if the schema was valid.
Definition SchemaParser.cpp:229
~SchemaParser()
Clean up.
Definition SchemaParser.cpp:39
SchemaParser()
Create a new SchemaParser.
Definition SchemaParser.cpp:33
The interface Json Schema Validators.
Definition JsonSchema.h:56
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
Represents a JSON double value broken down as separate components.
Definition Json.h:666