From 04265258045b7bfa5839c8a31cb8ebc02650e0ac Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Mon, 1 May 2023 20:35:42 -0500 Subject: [PATCH] Page turning Not working. Calling it a night. Will figure out page turning tomorrow. --- src/main.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f2927bd..2813698 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ Last edited: 5/1/23 use epub::doc::EpubDoc; use std::env; +use std::io; //initial function. Reads the ebook passed by argument. @@ -24,15 +25,27 @@ fn main() { //parses epub files fn epub(epub_file: &str){ let item_count = 1; - println!("{}", epub_file); let doc = EpubDoc::new(&epub_file); assert!(doc.is_ok()); let mut doc = doc.unwrap(); doc.set_current_page(50); let content = doc.get_current_str(); + while(true){ + let mut next = String::new(); + + io::stdin() + .read_line(&mut next) + .expect("Failed to read line"); + if next == "n"{ + doc.go_next(); + println!("{:?}", content); + } + + + } + - println!("{:?}", content); }