21 #ifndef COMMON_WEB_SCHEMAPARSECONTEXT_H_
22 #define COMMON_WEB_SCHEMAPARSECONTEXT_H_
32 #include "common/web/PointerTracker.h"
33 #include "common/web/SchemaErrorLogger.h"
34 #include "common/web/SchemaKeywords.h"
35 #include "common/web/OptionalItem.h"
42 class ArrayOfSchemaContext;
43 class ArrayOfStringsContext;
44 class DefinitionsParseContext;
45 class DependencyParseContext;
46 class JsonValueContext;
47 class PropertiesParseContext;
48 class SchemaParseContext;
86 m_keyword.Set(keyword);
93 std::string TakeKeyword() {
94 std::string keyword = m_keyword.Value();
102 const std::string& Keyword()
const {
return m_keyword.Value(); }
105 OptionalItem<std::string> m_keyword;
154 m_schema_defs(definitions) {
162 std::auto_ptr<SchemaParseContext> m_current_schema;
178 : m_schema_defs(definitions),
222 std::auto_ptr<JsonNumber> m_maximum;
223 std::auto_ptr<JsonNumber> m_minimum;
224 std::auto_ptr<JsonNumber> m_multiple_of;
235 std::auto_ptr<SchemaParseContext> m_additional_items_context;
238 std::auto_ptr<SchemaParseContext> m_items_single_context;
239 std::auto_ptr<ArrayOfSchemaContext> m_items_context_array;
248 std::auto_ptr<ArrayOfStringsContext> m_required_items;
249 std::auto_ptr<DependencyParseContext> m_dependency_context;
253 std::auto_ptr<class ArrayOfJsonValuesContext> m_enum_context;
254 std::auto_ptr<class ArrayOfSchemaContext> m_allof_context;
255 std::auto_ptr<class ArrayOfSchemaContext> m_anyof_context;
256 std::auto_ptr<class ArrayOfSchemaContext> m_oneof_context;
257 std::auto_ptr<class SchemaParseContext> m_not_context;
262 std::auto_ptr<const JsonValue> m_default_value;
263 std::auto_ptr<JsonValueContext> m_default_value_context;
270 std::auto_ptr<DefinitionsParseContext> m_definitions_context;
271 std::auto_ptr<PropertiesParseContext> m_properties_context;
273 std::auto_ptr<SchemaParseContext> m_additional_properties_context;
277 template <
typename T>
311 m_schema_defs(definitions) {
321 typedef std::map<std::string, SchemaParseContext*> SchemaMap;
324 SchemaMap m_property_contexts;
336 : m_schema_defs(definitions) {
353 typedef std::vector<SchemaParseContext*> ItemSchemas;
356 ItemSchemas m_item_schemas;
369 typedef std::set<std::string> StringSet;
445 bool Empty()
const {
return m_enums.empty(); }
448 std::vector<const JsonValue*> m_enums;
449 std::auto_ptr<JsonValueContext> m_value_context;
468 : m_schema_defs(definitions) {}
479 typedef std::set<std::string> StringSet;
480 typedef std::map<std::string, ValidatorInterface*> SchemaDependencies;
481 typedef std::map<std::string, StringSet> PropertyDependencies;
485 std::auto_ptr<ArrayOfStringsContext> m_property_context;
486 std::auto_ptr<SchemaParseContext> m_schema_context;
488 PropertyDependencies m_property_dependencies;
489 SchemaDependencies m_schema_dependencies;
495 #endif // COMMON_WEB_SCHEMAPARSECONTEXT_H_