1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-15 22:50:24 +02:00

array encoder

This commit is contained in:
Tao Wen
2017-01-09 19:48:57 +08:00
parent 552afb3625
commit 90fc0b822f
5 changed files with 74 additions and 12 deletions

View File

@ -171,6 +171,11 @@ func (stream *Stream) WriteObjectEnd() {
stream.writeByte('}')
}
func (stream *Stream) WriteEmptyObject() {
stream.writeByte('{')
stream.writeByte('}')
}
func (stream *Stream) WriteMore() {
stream.writeByte(',')
stream.writeIndention(0)
@ -182,6 +187,11 @@ func (stream *Stream) WriteArrayStart() {
stream.writeIndention(0)
}
func (stream *Stream) WriteEmptyArray() {
stream.writeByte('[')
stream.writeByte(']')
}
func (stream *Stream) WriteArrayEnd() {
stream.writeIndention(stream.IndentionStep)
stream.indention -= stream.IndentionStep