PropertyList service allows you to read and write property list files in all formats supported by the Core Foundation API: XML, binary, JSON, and OpenStep (read-only).
This service is only available on Darwin platforms such as iOS, macOS, tvOS, and watchOS.
Allocates and returns a new PropertyList object.
Voids the property list by deleting its internal object reference.
Returns true if the property list has no internal object reference set, otherwise false.
Returns the data format that the property list data was deserialized from. This property is set after calling
readFromFile. Possible return values include:
"xml1". If the property list object is empty or the input format could not be determined, returns
readFromFile(filePath: string): void
Parses the file and stores the result in the property list. Throws an exception if an I/O error occurs or the input is in an invalid format.
readFromObject(obj: any): void
Sets the given object as the property list's internal object.
format() will return
undefined as this method does not deserialize a storage format.
readFromString(input: string): void
input and stores the result in the property list. This is most useful for initializing a property list object from the result of a
JSON.stringify call. Throws an exception if the input is in an invalid format.
Returns an object representing the property list.
toJSON(style: string = "compact"): string
Returns a string representation of the property list in JSON format. Possible values for
"compact". The default is compact.
toString(format: string): string
Returns a string representation of the property list in the specified format. Possible values for
"xml1". Currently, the OpenStep format is not supported. Throws an exception if the object cannot be written in the given format.
Returns a string representation of the property list in XML format. This function is a synonym for
writeToFile(filePath: string, format: string): void
Writes the property list to the file in the given format. Possible values for
"xml1". Currently, the OpenStep format is not supported for writing. Throws an exception if an I/O error occurs or the object cannot be written in the given format.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.