//! # cocoa-archive
//!
//! A small library for generating archives for a limited set of macOS Cocoa
//! objects.
//!
//! This crate is primarily intended to produce property list values compatible
//! with `NSKeyedArchiver`-style encodings used by macOS applications,
//! especially base64-encoded property list `<data>` values.
//!
//! Currently supported archive targets include:
//!
//! - [`ArchiveTarget::Color`], corresponding to Cocoa's `NSColor`
//! - [`ArchiveTarget::Font`], corresponding to Cocoa's `NSFont`
//!
//! # Example
//!
//! ```rust
//! use cocoa_archive::*;
//!
//! let target = ArchiveTarget::Color {
//!     red: 1.0,
//!     green: 0.0,
//!     blue: 0.0,
//!     alpha: 1.0
//! };
//!
//! let mut writer = Vec::new();
//!
//! ArchiverVariant::KeyedArchiver
//!     .archive(target, ArchiveFormat::Base64, &mut writer)
//!     .unwrap();
//!
//! assert!(!writer.is_empty());
//! ```
//! # Output formats
//!
//! [`ArchiveFormat::Binary`] writes a binary property list.
//!
//! [`ArchiveFormat::Base64`] writes a base64-encoded binary property list,
//! suitable for property list `<data>` elements.
//!
//! # Compatibility
//!
//! This crate is not a complete implementation of Apple's `NSKeyedArchiver`.
//! It only supports the object types represented by [`ArchiveTarget`].
//!
//! The archives generated by this library are intended for compatibility with
//! macOS applications. They are not suitable as a general-purpose replacement for
//! the archives produced by Apple’s Foundation APIs.

#![forbid(unsafe_code)]
#![warn(missing_docs)]
#![warn(missing_debug_implementations)]

mod archiver;
mod b64;
mod object;
mod serializer;

pub use archiver::{ArchiveError, ArchiveFormat, ArchiveTarget, Archiver, ArchiverVariant};
