Class StringItem

Inheritance Relationships

Base Types

  • public zim::writer::BasicItem (Class BasicItem)

  • public std::enable_shared_from_this< StringItem >

Class Documentation

class StringItem : public zim::writer::BasicItem, public std::enable_shared_from_this<StringItem>

A StringItem is a full implemented item where the content is stored in a string.

Public Functions

virtual std::unique_ptr<ContentProvider> getContentProvider() const

The content provider of the item.

The content provider is responsible to provide the content to the creator. The returned content provider must stay valid even after creator release its reference to the item.

This method will be called once by libzim, in the main thread (but will be used in a different thread). The default IndexData will also call this method once (more) in the main thread (and use it in another thread).

Returns:

the contentProvider of the item.

Public Static Functions

template<typename ...Ts>
static inline std::shared_ptr<StringItem> create(Ts&&... params)

Create a StringItem with the given path, mimetype, title and content.

The parameters are the ones of the private constructor.

Parameters:
  • path – the path of the item.

  • mimetype – the mimetype of the item.

  • title – the title of the item.

  • content – the content of the item.

Protected Attributes

std::string content