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);
123 #endif // COMMON_WEB_SCHEMAPARSER_H_ SchemaDefinitions * ClaimSchemaDefs()
Claim the SchemaDefinitions that were created by parsing the schema.
Definition: SchemaParser.cpp:241
Represents a JSON double value broken down as separate components.
Definition: Json.h:661
ValidatorInterface * ClaimRootValidator()
Claim the RootValidator that was created by parsing the schema.
Definition: SchemaParser.cpp:237
The interface used to handle tokens during JSON parsing.
Definition: JsonLexer.h:71
The class used to parse JSON data.
void OpenObject()
Called when an object starts.
Definition: SchemaParser.cpp:170
void End()
Called when parsing completes.
Definition: SchemaParser.cpp:49
void Number(uint32_t value)
Called when a uint32_t is encountered.
Definition: SchemaParser.cpp:70
void Null()
Called when a null token is encountered.
Definition: SchemaParser.cpp:115
Definition: JsonSchema.h:946
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 ObjectKey(const std::string &key)
Called when a new key is encountered.
Definition: SchemaParser.cpp:192
void Begin()
Called when parsing begins.
Definition: SchemaParser.cpp:41
Build the tree of validators and a SchemaDefinitions object from a JSON Schema.
Definition: SchemaParser.h:49
void OpenArray()
Called when an array starts.
Definition: SchemaParser.cpp:134
void CloseObject()
Called when an object completes.
Definition: SchemaParser.cpp:206
void String(const std::string &value)
Called when a string is encountered.
Definition: SchemaParser.cpp:51
A JSON pointer (RFC 6901) refers to a possible element in a JSON data structure.
Definition: JsonPointer.h:66
The interface Json Schema Validators.
Definition: JsonSchema.h:56
void Bool(bool value)
Called when a bool is encountered.
Definition: SchemaParser.cpp:96
An implementation of Json Pointers (RFC 6901).
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
void CloseArray()
Called when an array completes.
Definition: SchemaParser.cpp:155
Maintains a Json Pointer (RFC 6901) given a set of Json parse events.
Definition: PointerTracker.h:77
~SchemaParser()
Clean up.
Definition: SchemaParser.cpp:39
SchemaParser()
Create a new SchemaParser.
Definition: SchemaParser.cpp:33
std::string Error() const
Get the error message.
Definition: SchemaParser.cpp:233
The SchemaErrorLogger captures errors while parsing the schema.
Definition: SchemaErrorLogger.h:41
bool IsValidSchema()
Check if the schema was valid.
Definition: SchemaParser.cpp:229