Project

General

Profile

Actions

Task #2021

closed

Extend MetaInfo abstraction to allow application-specific TLVs

Added by Alex Afanasyev about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

This change does not (strictly speaking) violate the protocol, rather than just extends what MetaInfo block holds.

Interface for this extension:

partial MetaInfo {
  /**
   * @brief Get all app-defined MetaInfo items
   */
  const std::list<Block>&
  getAppMetaInfo() const;

  /**
   * @brief Set app-defined MetaInfo items
   *
   * This method will replace all existing app-defined MetaInfo items, if they existed.
   */
  MetaInfo&
  setAppMetaInfo(const std::list<Block>& info);

  /**
   * @brief Add an app-defined MetaInfo item
   *
   * Note that only one
   */
  MetaInfo&
  addAppMetaInfo(const Block& block);

  /**
   * @brief Remove a first app-defined MetaInfo item with type @param tlvType
   *
   * @return true if an item was deleted
   */
  bool
  removeAppMetaInfo(uint32_t tlvType);

  /**
   * @brief Find a first app-defined MetaInfo item of type @param tlvType
   *
   * @return NULL if an item is not found, otherwise const pointer to the item
   */
  const Block*
  findAppMetaInfo(uint32_t tlvType) const;
};
Actions

Also available in: Atom PDF