mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 18:51:04 +08:00
docs
This commit is contained in:
parent
3b5f2b85ca
commit
38042b3892
@ -79,6 +79,7 @@ root["encoding"] = getCurrentEncoding();
|
|||||||
root["indent"]["length"] = getCurrentIndentLength();
|
root["indent"]["length"] = getCurrentIndentLength();
|
||||||
root["indent"]["use_space"] = getCurrentIndentUseSpace();
|
root["indent"]["use_space"] = getCurrentIndentUseSpace();
|
||||||
|
|
||||||
|
// (NEW IN 1.4.0)
|
||||||
// To write into a steam with minimal memory overhead,
|
// To write into a steam with minimal memory overhead,
|
||||||
// create a Builder for a StreamWriter.
|
// create a Builder for a StreamWriter.
|
||||||
Json::StreamWriterBuilder builder;
|
Json::StreamWriterBuilder builder;
|
||||||
|
@ -29,9 +29,9 @@ class Value;
|
|||||||
Usage:
|
Usage:
|
||||||
\code
|
\code
|
||||||
using namespace Json;
|
using namespace Json;
|
||||||
void writeToStdout(StreamWriter::Builder const& builder, Value const& value) {
|
void writeToStdout(StreamWriter::Factory const& factory, Value const& value) {
|
||||||
std::unique_ptr<StreamWriter> const writer(
|
std::unique_ptr<StreamWriter> const writer(
|
||||||
builder.newStreamWriter(&std::cout));
|
factory.newStreamWriter(&std::cout));
|
||||||
writer->write(value);
|
writer->write(value);
|
||||||
std::cout << std::endl; // add lf and flush
|
std::cout << std::endl; // add lf and flush
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ Usage:
|
|||||||
\code
|
\code
|
||||||
using namespace Json;
|
using namespace Json;
|
||||||
Value value = ...;
|
Value value = ...;
|
||||||
StreamWriter::Builder builder;
|
StreamWriterBuilder builder;
|
||||||
builder.cs_ = StreamWriter::CommentStyle::None;
|
builder.cs_ = StreamWriter::CommentStyle::None;
|
||||||
std::shared_ptr<StreamWriter> writer(
|
std::shared_ptr<StreamWriter> writer(
|
||||||
builder.newStreamWriter(&std::cout));
|
builder.newStreamWriter(&std::cout));
|
||||||
@ -154,7 +154,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** \brief Abstract class for writers.
|
/** \brief Abstract class for writers.
|
||||||
* \deprecated Use StreamWriter::Builder.
|
* \deprecated Use StreamWriter.
|
||||||
*/
|
*/
|
||||||
class JSON_API Writer {
|
class JSON_API Writer {
|
||||||
public:
|
public:
|
||||||
@ -170,7 +170,7 @@ public:
|
|||||||
*consumption,
|
*consumption,
|
||||||
* but may be usefull to support feature such as RPC where bandwith is limited.
|
* but may be usefull to support feature such as RPC where bandwith is limited.
|
||||||
* \sa Reader, Value
|
* \sa Reader, Value
|
||||||
* \deprecated Use StreamWriter::Builder.
|
* \deprecated Use OldCompressingStreamWriterBuilder.
|
||||||
*/
|
*/
|
||||||
class JSON_API FastWriter : public Writer {
|
class JSON_API FastWriter : public Writer {
|
||||||
public:
|
public:
|
||||||
@ -222,7 +222,7 @@ private:
|
|||||||
*#CommentPlacement.
|
*#CommentPlacement.
|
||||||
*
|
*
|
||||||
* \sa Reader, Value, Value::setComment()
|
* \sa Reader, Value, Value::setComment()
|
||||||
* \deprecated Use StreamWriter::Builder.
|
* \deprecated Use StreamWriterBuilder.
|
||||||
*/
|
*/
|
||||||
class JSON_API StyledWriter : public Writer {
|
class JSON_API StyledWriter : public Writer {
|
||||||
public:
|
public:
|
||||||
@ -284,7 +284,7 @@ private:
|
|||||||
*
|
*
|
||||||
* \param indentation Each level will be indented by this amount extra.
|
* \param indentation Each level will be indented by this amount extra.
|
||||||
* \sa Reader, Value, Value::setComment()
|
* \sa Reader, Value, Value::setComment()
|
||||||
* \deprecated Use StreamWriter::Builder.
|
* \deprecated Use StreamWriterBuilder.
|
||||||
*/
|
*/
|
||||||
class JSON_API StyledStreamWriter {
|
class JSON_API StyledStreamWriter {
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user