Studying Papyrix's support for FictionBook2 ebooks...
To open such ebooks Papyrix closes the existing file if any, creates a Fb2 object & invokes its load method, clears metadata setting its `type` property, extracts the ebook's title into the metadata followed by the author as well as filepaths to the cache & cover bitmap, & sets some initial pagecount properties.
The close method defers both to the metadata & that Fb2 object. To get the page count it (again) estimates 2KiB per page.
1/?
There's methods which defer to the Fb2 object's, if any, getters. Possibly reformatting results into common datastructures.
And there's a method which concatenates together the filepath to a cached section.
That Fb2 class is defined in a support library. Its constructor concatenates together the path to the file's cache & extracts the basename as a title. Its destructor finalizes its Expat XML parser if any.
Then there's that load method...
2/?