Skip to content

Commit

Permalink
Merge branch 'master' into issue716_parsebyparts
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed Sep 3, 2016
2 parents 0f9dbe0 + 9f66882 commit 8979c14
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/features.zh-cn.md
Expand Up @@ -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。
* 支持可选的放宽语法
Expand Down
4 changes: 2 additions & 2 deletions include/rapidjson/document.h
Expand Up @@ -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; }

Expand All @@ -328,6 +326,8 @@ struct GenericStringRef {
//! Disallow construction from non-const array
template<SizeType N>
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
Expand Down
2 changes: 1 addition & 1 deletion include/rapidjson/schema.h
Expand Up @@ -1473,7 +1473,7 @@ class GenericSchemaDocument {

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)) {
Expand Down
4 changes: 2 additions & 2 deletions readme.zh-cn.md
Expand Up @@ -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)`

## 用法一览

Expand Down
2 changes: 1 addition & 1 deletion test/unittest/schematest.cpp
Expand Up @@ -1101,7 +1101,7 @@ class RemoteSchemaDocumentProvider : public IGenericRemoteSchemaDocumentProvider
};

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;
}
Expand Down

0 comments on commit 8979c14

Please sign in to comment.