1704 :
1705 documentAllocator_(documentBuffer_, sizeof(documentBuffer_)),
1706 schemaAllocator_(schemaBuffer_, sizeof(schemaBuffer_))
1707 {
1708 const char* filenames[kCount] = {
1709 "jsonschema/remotes/integer.json",
1710 "jsonschema/remotes/subSchemas.json",
1711 "jsonschema/remotes/folder/folderInteger.json",
1712 "draft-04/schema"
1713 };
1714 const char* uris[kCount] = {
1715 "http://localhost:1234/integer.json",
1716 "http://localhost:1234/subSchemas.json",
1717 "http://localhost:1234/folder/folderInteger.json",
1718 "http://json-schema.org/draft-04/schema"
1719 };
1720
1721 for (size_t i = 0; i < kCount; i++) {
1722 sd_[i] = 0;
1723
1724 char jsonBuffer[8192];
1726 char* json = ReadFile(filenames[i], jsonAllocator);
1727 if (!json) {
1728 printf(
"json remote file %s not found", filenames[i]);
1730 }
1731 else {
1732 char stackBuffer[4096];
1734 DocumentType
d(&documentAllocator_, 1024, &stackAllocator);
1736 sd_[i] =
new SchemaDocumentType(d, uris[i],
static_cast<SizeType>(strlen(uris[i])), 0, &schemaAllocator_);
1738 }
1739 };
1740 }
Default memory allocator used by the parser and DOM.
static void Free(void *ptr)
Frees a memory block (concept Allocator)
LOGGING_API void printf(Category category, const char *format,...)
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)