nskeyedarchiver

package module
v0.0.0-...-f3ef49f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 6 Imported by: 1

README

archived in favor of https://github.com/danielpaulus/go-ios which has a fully working DTX implementation and can run UI tests on linux

nskeyedarchiver

A Golang based implementation of Swift/ObjectiveCs NSKeyedArchiver/NSKeyedUnarchiver

Unarchive extracts NSKeyedArchiver Plists, either in XML or Binary format, and returns an array of the archived objects converted to usable Go Types.

  • Primitives will be extracted just like regular Plist primitives (string, float64, int64, []uint8 etc.).
  • NSArray, NSMutableArray, NSSet and NSMutableSet will transformed into []interface{}
  • NSDictionary and NSMutableDictionary will be transformed into map[string] interface{}. I might add non string keys later.

Todos:

  • Add custom object support (anything that is not an array, set or dictionary)
  • Add archiving/encoding support

Thanks howett.net/plist for your awesome Plist library :-)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToPlist

func ToPlist(data interface{}) string

ToPlist converts a given struct to a Plist using the github.com/DHowett/go-plist library. Make sure your struct is exported. It returns a string containing the plist.

func Unarchive

func Unarchive(xml []byte) ([]interface{}, error)

Unarchive extracts NSKeyedArchiver Plists, either in XML or Binary format, and returns an array of the archived objects converted to usable Go Types. Primitives will be extracted just like regular Plist primitives (string, float64, int64, []uint8 etc.). NSArray, NSMutableArray, NSSet and NSMutableSet will transformed into []interface{} NSDictionary and NSMutableDictionary will be transformed into map[string] interface{}. I might add non string keys later.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL