seeyou-cupx
A Rust library for parsing and writing SeeYou CUPX files, commonly used in aviation and gliding for waypoints with attached pictures.
CUPX files consist of two concatenated ZIP archives: a "pics" archive containing images and a "points" archive containing a POINTS.CUP file with waypoint and task data. For more details, see the official CUPX file format specification.
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
Reading CUPX files
use CupxFile;
use Read;
let = from_path?;
// Access waypoint data
for waypoint in cupx.waypoints
// Access pictures
for pic_name in cupx.picture_names
// Read a specific picture
let mut reader = cupx.read_picture?;
let mut buffer = Vecnew;
reader.read_to_end?;
# Ok::
Writing CUPX files
use CupFile;
use CupxWriter;
use Path;
new
.add_picture
.add_picture
.write_to_path?;
# Ok::
Encoding Support
By default, the library automatically detects the text encoding of CUP files. If you know the encoding beforehand:
use Encoding;
use CupxFile;
let = from_path_with_encoding?;
# Ok::
Dependencies
This library uses seeyou-cup for parsing and writing the underlying CUP file format.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.