use std;
impl<'ole> super::thumbsdb::ThumbsDb<'ole> {
pub(crate) fn read_catalog(&mut self) -> Result<(), super::error::Error> {
if let Some(catalog_entry) = self.ole.iterate().skip_while(
|e| e.name() != "Catalog").next() {
use std::io::Read;
self.content = std::vec::Vec::with_capacity(catalog_entry.len());
let mut slice = self.ole.get_entry_slice(catalog_entry)
.map_err(super::error::Error::OLEError)?;
slice.read_to_end(&mut self.content)
.map_err(super::error::Error::IOError)?;
Ok(())
} else {
Err(super::error::Error::NotThumbsDbFile)
}
}
}