From 3b2441b87f99ab65f37b141a7b548ebadb607b96 Mon Sep 17 00:00:00 2001 From: Janusz Chorko Date: Fri, 26 Aug 2016 21:17:38 +0200 Subject: [PATCH 1/4] Removed non-compiling assignment operator. Fixed #718 --- include/rapidjson/document.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index e3e20df..b0f1f70 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -316,8 +316,6 @@ struct GenericStringRef { GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} - GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } - //! implicit conversion to plain CharType pointer operator const Ch *() const { return s; } From 862c39be371278a45a88d4d1d75164be57bb7e2d Mon Sep 17 00:00:00 2001 From: Janusz Chorko Date: Fri, 26 Aug 2016 21:26:50 +0200 Subject: [PATCH 2/4] Explicitly disable copy assignment operator --- include/rapidjson/document.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index b0f1f70..19f5a6a 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -326,6 +326,8 @@ private: //! Disallow construction from non-const array template GenericStringRef(CharType (&str)[N]) /* = delete */; + //! Copy assignment operator not permitted - immutable type + GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; }; //! Mark a character pointer as constant string From 250cf666d321b03b3456ace94fdb5647d796fa92 Mon Sep 17 00:00:00 2001 From: niukuo Date: Mon, 29 Aug 2016 21:38:06 +0800 Subject: [PATCH 3/4] fix wrong length in remote schema Change-Id: Ia96ddf5746f1c18968e9e086f17fe4a24b8480d7 --- include/rapidjson/schema.h | 2 +- test/unittest/schematest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index b182aa2..8497d30 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -1473,7 +1473,7 @@ private: if (i > 0) { // Remote reference, resolve immediately if (remoteProvider_) { - if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i - 1)) { + if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i)) { PointerType pointer(&s[i], len - i, allocator_); if (pointer.IsValid()) { if (const SchemaType* sc = remoteDocument->GetSchema(pointer)) { diff --git a/test/unittest/schematest.cpp b/test/unittest/schematest.cpp index d75b1e5..6a8b685 100644 --- a/test/unittest/schematest.cpp +++ b/test/unittest/schematest.cpp @@ -1101,7 +1101,7 @@ public: }; for (size_t i = 0; i < kCount; i++) - if (strncmp(uri, uris[i], length) == 0) + if (strncmp(uri, uris[i], length) == 0 && strlen(uris[i]) == length) return sd_[i]; return 0; } From 6023ed3a0cb5fe21b2148035619b93713919a004 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Fri, 2 Sep 2016 17:35:40 +0800 Subject: [PATCH 4/4] Fix typo in doc --- doc/features.zh-cn.md | 2 +- readme.zh-cn.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/features.zh-cn.md b/doc/features.zh-cn.md index fd3fd4d..19908a8 100644 --- a/doc/features.zh-cn.md +++ b/doc/features.zh-cn.md @@ -22,7 +22,7 @@ * RapidJSON 应完全符合 RFC4627/ECMA-404 标准。 * 支持 JSON Pointer (RFC6901). * 支持 JSON Schema Draft v4. -* 支持 Unicod 代理对(surrogate pair)。 +* 支持 Unicode 代理对(surrogate pair)。 * 支持空字符(`"\u0000"`)。 * 例如,可以优雅地解析及处理 `["Hello\u0000World"]`。含读写字符串长度的 API。 * 支持可选的放宽语法 diff --git a/readme.zh-cn.md b/readme.zh-cn.md index 74d267c..b62b2e1 100644 --- a/readme.zh-cn.md +++ b/readme.zh-cn.md @@ -80,13 +80,13 @@ RapidJSON 依赖于以下软件: 生成测试及例子的步骤: 1. 执行 `git submodule update --init` 去获取 thirdparty submodules (google test)。 -2. 在 rapidjson 目渌下,建立一个 `build` 目录。 +2. 在 rapidjson 目录下,建立一个 `build` 目录。 3. 在 `build` 目录下执行 `cmake ..` 命令以设置生成。Windows 用户可使用 cmake-gui 应用程序。 4. 在 Windows 下,编译生成在 build 目录中的 solution。在 Linux 下,于 build 目录运行 `make`。 成功生成后,你会在 `bin` 的目录下找到编译后的测试及例子可执行文件。而生成的文档将位于 build 下的 `doc/html` 目录。要执行测试,请在 build 下执行 `make test` 或 `ctest`。使用 `ctest -V` 命令可获取详细的输出。 -我们也可以把程序库安装至全系统中,只要在具管理權限下从 build 目录执行 `make install` 命令。这样会按系统的偏好设置安装所有文件。当安装 RapidJSON 后,其他的 CMake 项目需要使用它时,可以通过在 `CMakeLists.txt` 加入一句 `find_package(RapidJSON)`。 +我们也可以把程序库安装至全系统中,只要在具管理权限下从 build 目录执行 `make install` 命令。这样会按系统的偏好设置安装所有文件。当安装 RapidJSON 后,其他的 CMake 项目需要使用它时,可以通过在 `CMakeLists.txt` 加入一句 `find_package(RapidJSON)`。 ## 用法一览