Expand description
§Overview
PRTGN_encoding (listed as prtgn_encoding for Cargo.TOML) is a library used by programs compatible with PRTGN files to encode and decode them.
Any file can be encoded with PRTGN, though for user convenience it is highly recommended to use the .prtgn extension. What is being writen isn’t a text file, simply add the original file extension to the end. Such as .prtgn_wav does.
Going along with that, anything can be encoded with PRTGN. As long as what is given to the write function as a string.
An example of this is used by PRTGN for the wav file. wav_converter.rs | PRTGN version 0.3.1, added in version 0.3.0.
wav_converter.rs takes a wav file, reads its data, converts the data buffer to a string, and then writes it to a prtgn_wav file. The opposite is done for playing the wav file.
Simply add PRTGN_encoding to your Cargo.TOML and add the following to your file to access commands depending on what you need!
§Read Only
use prtgn_encoding::read;§Write Only
use prtgn_encoding::write;§Read and Write
use prtgn_encoding::{read, write};§Example File Usage
§Basic Write Example
cargo run --example basic_write§Basic Read Example
Run the write example first in order to have a correctly encoded PRTGN file with the right name
cargo run --example basic_read§Read Write Combo Example
cargo run --example read_write