PlistAPI 1.1.0
See the version list below for details.
dotnet add package PlistAPI --version 1.1.0
NuGet\Install-Package PlistAPI -Version 1.1.0
<PackageReference Include="PlistAPI" Version="1.1.0" />
paket add PlistAPI --version 1.1.0
#r "nuget: PlistAPI, 1.1.0"
// Install PlistAPI as a Cake Addin #addin nuget:?package=PlistAPI&version=1.1.0 // Install PlistAPI as a Cake Tool #tool nuget:?package=PlistAPI&version=1.1.0
PlistAPI
PlistAPI - is a library that allows you not just deserialize
and serialize
the .plist
format, but even deserialize
and serialize
the data as specific objects, here is an example:
.plist
(basically a little changed .xml) format
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SomeKey</key>
<string>SomeValue</string>
</dict>
</plist>
Deserialization
using var fileStream = File.Open("filePath");
Plist.Deserialize<SomeClass>(fileStream);
[PlistObject]
class SomeClass
{
[PlistProperty("SomeKey")] public string SomeKey { get; set; }
}
Also you are able not to provide PlistProperty.Id
( [PlistProperty(string: Id)] ), but the property name must match the Key
(Be careful, its case-sensitive, by providing id
either).
Serialization
// deserialize
using var fileStream = File.Open("filePath");
var deserialized = Plist.Deserialize<SomeClass>(fileStream);
// serialize
Plist.Serialize<SomeClass>(deserialized);
// OR
// Plist.Serialize(deserialized);
[PlistObject]
class SomeClass
{
[PlistProperty("SomeKey")] public string SomeKey { get; set; }
}
By NOT providing the type in the generic of Serialize()
, the serialization will be UNsegnifically slower, but anyways it will! (because of reflection manipulations to obtain the type from the object instance)
Invalid Data Handling
You can use PlistInvalidDataHandlingType
to handle invalid data, example:
var settings = new PlistSettings() { InvalidDataHandlingType = PlistInvalidDataHandlingType.ReturnNull };
// then use this settings
/*
* Plist.Deserialize<T>(data, settings);
* Plist.Serialize<T>(data, settings);
* new Plist(settings).Load(data);
* await new Plist(settings).LoadAsync(data);
etc...
*/
Other features
This library can
deserialize
and full-named (<key></key>
,<string></string>
...), and short-named (<k></k>
,<s></s>
...) key-values, and both at the same time (check details in thePlistAPI.Tests
project), but serialize obviously strong-type only (full-named or short-named)You can choose whether the serialized output will be indent-formatted or not
Also the library uses faster value parsers (faster float parser, and faster int parser)
You can
TODO
- A little refactor
- Add
PlistConverter
attribute for properties to automatically change the type whenserializing/deserializing
at the runtime
Library is being completely maintenanced by me, so dont be shy and pull some issues 😃
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- csFastFloat (>= 4.1.0)
-
.NETStandard 2.1
- csFastFloat (>= 4.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.