docs » hs.plist
Read and write Property List files
- Functions - API calls offered directly by the extension
- read
- readString
- write
- writeString
| Signature | hs.plist.read(filepath) -> table |
|---|---|
| Type | Function |
| Description | Loads a Property List file |
| Parameters |
|
| Returns |
|
| Signature | hs.plist.readString(value, [binary]) -> table | nil |
| -----------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| Type | Function |
| Description | Interpretes a property list file within a string into a table. |
| Parameters |
- value - The contents of the property list as a string
- binary - an optional boolean, specifying whether the value should be treated as raw binary (true) or as an UTF8 encoded string (false). If you do not provide this argument, the function will attempt to auto-detect the type.
- The contents of the property list as a Lua table or
nilif an error occurs
| Signature | hs.plist.write(filepath, data[, binary]) -> boolean |
|---|---|
| Type | Function |
| Description | Writes a Property List file |
| Parameters |
|
| Returns |
|
| Notes |
|
| Signature | hs.plist.writeString(data, [binary]) -> string | nil |
| -----------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| Type | Function |
| Description | Interpretes a property list file within a string into a table. |
| Parameters |
- data - A Lua table containing the data to write into a plist string
- binary - an optional boolean, default false, specifying that the resulting string should be encoded as a binary plist.
- A string representing the data as a plist or nil if there was a problem with the date or serialization.