Class BasicItem

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class BasicItem : public zim::writer::Item

A BasicItem is a partial implementation of a Item.

BasicItem provides a basic implementation for everything about an Item but the actual content of the item.

Subclassed by zim::writer::FileItem, zim::writer::StringItem

Public Functions

inline BasicItem(const std::string &path, const std::string &mimetype, const std::string &title, Hints hints)

Create a BasicItem with the given path, mimetype and title.

Parameters:
  • path – the path of the item.

  • mimetype – the mimetype of the item.

  • title – the title of the item.

inline virtual std::string getPath() const

The path of the item.

The path must be absolute. Path must be unique.

Returns:

the path of the item.

inline virtual std::string getTitle() const

The title of the item.

Item’s title is indexed and is used for the suggestion system. Title don’t have to be unique.

Returns:

the title of the item.

inline virtual std::string getMimeType() const

The mimetype of the item.

Mimetype is store within the content. It is also used to detect if the content must be compressed or not.

Returns:

the mimetype of the item.

inline virtual Hints getHints() const

Hints to help the creator takes decision about the item.

For now two hints are supported:

  • COMPRESS: Can be used to force the creator to put the item content in a compressed cluster (if true) or not (if false). If the hint is not provided, the decision is taken based on the mimetype (textual or binary content ?)

  • FRONT_ARTICLE: Can (Should) be used to specify if the item is a front article or not. If the hint is not provided, the decision is taken based on the mimetype (html or not ?)

Returns:

A list of hints.

Protected Attributes

std::string path
std::string mimetype
std::string title
Hints hints