mirror of
https://github.com/claunia/plist-cil.git
synced 2026-02-04 05:34:41 +00:00
[PR #21] [MERGED] Binary compatibility with the Apple Plist format #53
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/claunia/plist-cil/pull/21
Author: @qmfrederik
Created: 3/7/2017
Status: ✅ Merged
Merged: 5/20/2017
Merged by: @claunia
Base:
master← Head:fixes/binary-compatibility📝 Commits (3)
6c95260Maintain binary compatibility with the Apple format: disable optimizations and add the same UID, NSArray and NSString values multiple times to the property list file.8dc5f8bMake sure that the NSString which represents keys in a NSDictionary is always the same value, by caching the string to NSString conversion in a dictionaryb4974acDon't reuse object IDs for NSNumber objects📊 Changes
2 files changed (+57 additions, -10 deletions)
View changed files
📝
plist-cil/BinaryPropertyListWriter.cs(+39 -7)📝
plist-cil/NSDictionary.cs(+18 -3)📄 Description
We use plist-cil to implement one of Apple's protocols, and we strive to get binary compatibility. That is, we generate the exact same value on disk as the macOS tools do.
We've noticed that plist-cil tries to re-use object IDs in a property list: if you add the same object twice, the
BinaryPropertyListWriterwill add it once to the property list file and re-use the same ID.Unfortunately, we hit a scenario where we need to write same value twice to the file, with different IDs.
This PR implements that. Because it would be a pitty to loose the optimization, we've added a
ReuseObjectIdsproperty which can be used to control this behavior.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.