Fix TODOs in DOM documentation
This commit is contained in:
parent
b72219e7bb
commit
6968fc5a36
18
doc/dom.md
18
doc/dom.md
@ -156,7 +156,17 @@ To get an error message, RapidJSON provided a English messages in `rapidjson/err
|
|||||||
Here shows an example of parse error handling.
|
Here shows an example of parse error handling.
|
||||||
|
|
||||||
~~~~~~~~~~cpp
|
~~~~~~~~~~cpp
|
||||||
// TODO: example
|
#include "rapidjson/document.h"
|
||||||
|
#include "rapidjson/error/en.h"
|
||||||
|
|
||||||
|
// ...
|
||||||
|
Document d;
|
||||||
|
if (d.Parse(json).HasParseError()) {
|
||||||
|
fprintf(stderr, "\nError(offset %u): %s\n",
|
||||||
|
(unsigned)reader.GetErrorOffset(),
|
||||||
|
GetParseError_En(reader.GetParseErrorCode()));
|
||||||
|
// ...
|
||||||
|
}
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
## In Situ Parsing {#InSituParsing}
|
## In Situ Parsing {#InSituParsing}
|
||||||
@ -241,11 +251,7 @@ d.Accept(writer);
|
|||||||
|
|
||||||
Actually, `Value::Accept()` is responsible for publishing SAX events about the value to the handler. With this design, `Value` and `Writer` are decoupled. `Value` can generate SAX events, and `Writer` can handle those events.
|
Actually, `Value::Accept()` is responsible for publishing SAX events about the value to the handler. With this design, `Value` and `Writer` are decoupled. `Value` can generate SAX events, and `Writer` can handle those events.
|
||||||
|
|
||||||
User may create customer handlers for transforming the DOM into other formats. For example, a handler which converts the DOM into XML.
|
User may create custom handlers for transforming the DOM into other formats. For example, a handler which converts the DOM into XML.
|
||||||
|
|
||||||
~~~~~~~~~~cpp
|
|
||||||
// TODO: example
|
|
||||||
~~~~~~~~~~
|
|
||||||
|
|
||||||
For more about SAX events and handler, please refer to [SAX](doc/sax.md).
|
For more about SAX events and handler, please refer to [SAX](doc/sax.md).
|
||||||
|
|
||||||
|
@ -156,7 +156,17 @@ GenericDocument& GenericDocument::Parse(const Ch* str);
|
|||||||
以下是一个处理错误的例子。
|
以下是一个处理错误的例子。
|
||||||
|
|
||||||
~~~~~~~~~~cpp
|
~~~~~~~~~~cpp
|
||||||
// TODO: example
|
#include "rapidjson/document.h"
|
||||||
|
#include "rapidjson/error/en.h"
|
||||||
|
|
||||||
|
// ...
|
||||||
|
Document d;
|
||||||
|
if (d.Parse(json).HasParseError()) {
|
||||||
|
fprintf(stderr, "\nError(offset %u): %s\n",
|
||||||
|
(unsigned)reader.GetErrorOffset(),
|
||||||
|
GetParseError_En(reader.GetParseErrorCode()));
|
||||||
|
// ...
|
||||||
|
}
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
## 原位解析 {#InSituParsing}
|
## 原位解析 {#InSituParsing}
|
||||||
@ -247,10 +257,6 @@ d.Accept(writer);
|
|||||||
|
|
||||||
使用者可以创建自定义的处理器,去把DOM转换成其它格式。例如,一个把DOM转换成XML的处理器。
|
使用者可以创建自定义的处理器,去把DOM转换成其它格式。例如,一个把DOM转换成XML的处理器。
|
||||||
|
|
||||||
~~~~~~~~~~cpp
|
|
||||||
// TODO: example
|
|
||||||
~~~~~~~~~~
|
|
||||||
|
|
||||||
要知道更多关于SAX事件与处理器,可参阅[SAX](doc/sax.md)。
|
要知道更多关于SAX事件与处理器,可参阅[SAX](doc/sax.md)。
|
||||||
|
|
||||||
## 使用者缓冲区{ #UserBuffer}
|
## 使用者缓冲区{ #UserBuffer}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user