[bplist] Rewrite the object parser to add cycle detection

This commit:
- Replaces valueAtOffset with objectAtIndex, which does boundary checks
- Replaces most uses of object offsets with object IDs
- Adds object IDs to most error messages
- Cleans up the dictionary and array deserializers
- Adds support for cycle detection; this can be optimized if necessary,
  but as long as object graphs remain shallow should be performant
- Removes the full object table deserialization step; only objects
  referred to directly by the root object will be deserialized.
- Introduces must/must2 to remove some error panics from
  bplist_parser.go

Fixes #23.
3 files changed
tree: 9990671a6a322786ef73ffa50bfc19d4dd4e30ec
  1. ply/
  2. .travis.yml
  3. bplist.go
  4. bplist_generator.go
  5. bplist_parser.go
  6. bplist_test.go
  7. common_data_for_test.go
  8. decode.go
  9. decode_test.go
  10. doc.go
  11. encode.go
  12. encode_test.go
  13. example_custom_marshaler_test.go
  14. fuzz.go
  15. invalid_bplist_test.go
  16. invalid_text_test.go
  17. LICENSE
  18. marshal.go
  19. marshal_test.go
  20. must.go
  21. plist.go
  22. plist_types.go
  23. README.md
  24. text.go
  25. text_tables.go
  26. text_test.go
  27. typeinfo.go
  28. unmarshal.go
  29. unmarshal_test.go
  30. util.go
  31. xml.go
  32. xml_test.go
README.md

plist - A pure Go property list transcoder

INSTALL

$ go get howett.net/plist

FEATURES

  • Supports encoding/decoding property lists (Apple XML, Apple Binary, OpenStep and GNUStep) from/to arbitrary Go types

USE

package main
import (
	"howett.net/plist"
	"os"
)
func main() {
	encoder := plist.NewEncoder(os.Stdout)
	encoder.Encode(map[string]string{"hello": "world"})
}