FileParser -> FileDataParser

Let the FileParser be a FileDataParser, so we have uncoupled the header
parsers from the data parsers.

This way we can make the parsing process multithreaded.
This commit is contained in:
Matthias Beyer 2015-10-28 18:57:26 +01:00
parent 1166f313a3
commit 6fa42204cb
1 changed files with 4 additions and 4 deletions

View File

@ -123,10 +123,10 @@ pub mod file {
fn get_abbrev(&self) -> String;
}
pub trait FileParser {
fn new(header_parser: &header::FileHeaderParser) -> FileParser;
fn read(&self, string: String) -> (header::FileHeaderData, FileData);
fn write(&self, hdr: &header::FileHeaderData, data: &FileData) -> Result<String, ParserError>;
pub trait FileDataParser {
fn new() -> FileDataParser;
fn read(&self, string: String) -> FileData;
fn write(&self, data: &FileData) -> Result<String, ParserError>;
}
pub type HeaderDataTpl = (Option<String>, Option<String>);