Struct strfile::strfile::Strfile [] [src]

pub struct Strfile {
    pub version: u32,
    pub number_of_strings: u32,
    pub longest_length: u32,
    pub shortest_length: u32,
    pub flags: u32,
    pub delim: u8,
    pub offsets: Vec<u32>,
}

Fields

Version of the header.

Number of strings stored in fortune file.

Length of the longest quote.

Length of the shortest quote.

Bit field for flags.

Delimeter used for separating quotes.

Byte offsets to beginnings of the strings.

Methods

impl Strfile
[src]

Check if flag is set.

Examples:

use strfile::{Strfile, Flags};

fn main() {
    let header = Strfile::parse("fortune.dat".to_owned()).unwrap();
    println!("ROT13: {}", if header.is_flag_set(Flags::Rotated) { "yes" } else { "no" });
}

Read strfile header contents from a file.

Example usage:

use strfile::Strfile;

pub fn main() {
    let header = Strfile::parse("fortune.dat".to_owned()).unwrap():;
    println!("Header contents: {:?}", header);
}

Trait Implementations

impl Debug for Strfile
[src]

Formats the value using the given formatter.