1
0
mirror of https://github.com/json-iterator/go.git synced 2025-12-23 23:33:38 +02:00

document public symbols

This commit is contained in:
Tao Wen
2017-07-09 16:09:23 +08:00
parent 46574e7d09
commit f0487718f6
22 changed files with 227 additions and 176 deletions

View File

@@ -1,14 +1,3 @@
// Package jsoniter implements encoding and decoding of JSON as defined in
// RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json.
// Converting from encoding/json to jsoniter is no more than replacing the package with jsoniter
// and variable type declarations (if any).
// jsoniter interfaces gives 100% compatibility with code using standard lib.
//
// "JSON and Go"
// (https://golang.org/doc/articles/json_and_go.html)
// gives a description of how Marshal/Unmarshal operate
// between arbitrary or predefined json objects and bytes,
// and it applies to jsoniter.Marshal/Unmarshal as well.
package jsoniter
import (
@@ -96,7 +85,7 @@ func (adapter *Decoder) Buffered() io.Reader {
func (decoder *Decoder) UseNumber() {
origCfg := decoder.iter.cfg.configBeforeFrozen
origCfg.UseNumber = true
decoder.iter.cfg = origCfg.Froze()
decoder.iter.cfg = origCfg.Froze().(*frozenConfig)
}
func NewEncoder(writer io.Writer) *Encoder {
@@ -119,6 +108,6 @@ func (adapter *Encoder) SetIndent(prefix, indent string) {
func (adapter *Encoder) SetEscapeHTML(escapeHtml bool) {
config := adapter.stream.cfg.configBeforeFrozen
config.EscapeHtml = escapeHtml
adapter.stream.cfg = config.Froze()
config.EscapeHTML = escapeHtml
adapter.stream.cfg = config.Froze().(*frozenConfig)
}