Class Item¶
Defined in File item.h
Inheritance Relationships¶
Base Type¶
private zim::Entry
(Class Entry)
Class Documentation¶
-
class Item : private zim::Entry¶
-
There is no public constructor - the only way to obtain an
Item
is viaEntry::getItem()
orEntry::getRedirect()
.All
Item
’s methods are threadsafe.Public Types
-
typedef std::pair<std::string, offset_type> DirectAccessInfo¶
Public Functions
-
inline std::string getTitle() const¶
-
inline std::string getPath() const¶
-
std::string getMimetype() const¶
-
Blob getData(offset_type offset = 0) const¶
Get the data associated to the item
Get the data of the item, starting at offset.
- Parameters:
offset – The number of byte to skip at begining of the data.
- Returns:
A blob corresponding to the data.
-
Blob getData(offset_type offset, size_type size) const¶
Get the data associated to the item
Get the
size
bytes of data of the item, starting at offset.- Parameters:
offset – The number of byte to skip at begining of the data.
size – The number of byte to read.
- Returns:
A blob corresponding to the data.
-
DirectAccessInfo getDirectAccessInformation() const¶
Direct access information.
Some item are stored raw in the zim file. If possible, this function give information about which file and at which to read to get the data.
It can be usefull as an optimisation when interacting with other system by reopeing the file and reading the content bypassing the libzim.
- Returns:
A pair of filename/offset specifying where read the content. If it is not possible to have direct access for this item, return a pair of
{"", 0}
-
inline entry_index_type getIndex() const¶
-
typedef std::pair<std::string, offset_type> DirectAccessInfo¶