AppleBundleResources serializer and deserializer for Rust. This library will also likely continue to stay up to date with the official Apple Bundle Resources specification as changes happen.
# Cargo.toml
[]
= "*"
Create Info.plist
by yourself:
let properties = InfoPlist ;
// Create Info.plist file
let file_path = dir.path.join;
let file = create.unwrap;
// Write to Info.plist file
to_writer_xml.unwrap;
Or parse any Info.plist
file:
pub const PLIST_FILE_EXAMPLE: &str = r#"<?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>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleIdentifier</key>
<string>com.test.test-id</string>
<key>CFBundleName</key>
<string>Test</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>1.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIRequiresFullScreen</key>
<false />
<key>CFBundleExecutable</key>
<string>test</string>
</dict>
</plist>"#;
// Read from bytes
let properties: InfoPlist = from_bytes.unwrap;
// Or from file
let file_path = "/path/to/Info.plist";
let properties: InfoPlist = from_file.unwrap;
License
This project is licensed under Apache License, Version 2.0, (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in toml-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.