libimgdoc2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
imgdoc2::IDocumentMetadataRead Class Referenceabstract

The interface for read-only access to document metadata. More...

#include <IDocumentMetadata.h>

Inheritance diagram for imgdoc2::IDocumentMetadataRead:
imgdoc2::IDocumentMetadata

Public Member Functions

virtual imgdoc2::DocumentMetadataItem GetItem (imgdoc2::dbIndex primary_key, DocumentMetadataItemFlags flags)=0
 
virtual imgdoc2::DocumentMetadataItem GetItemForPath (const std::string &path, imgdoc2::DocumentMetadataItemFlags flags)=0
 
virtual void EnumerateItems (std::optional< imgdoc2::dbIndex > parent, bool recursive, DocumentMetadataItemFlags flags, const std::function< bool(imgdoc2::dbIndex, const DocumentMetadataItem &item)> &func)=0
 
virtual void EnumerateItemsForPath (const std::string &path, bool recursive, DocumentMetadataItemFlags flags, const std::function< bool(imgdoc2::dbIndex, const DocumentMetadataItem &item)> &func)=0
 
 IDocumentMetadataRead (const IDocumentMetadataRead &)=delete
 
IDocumentMetadataReadoperator= (const IDocumentMetadataRead &)=delete
 
 IDocumentMetadataRead (IDocumentMetadataRead &&)=delete
 
IDocumentMetadataReadoperator= (IDocumentMetadataRead &&)=delete
 

Additional Inherited Members

Detailed Description

The interface for read-only access to document metadata.

Member Function Documentation

◆ EnumerateItems()

virtual void imgdoc2::IDocumentMetadataRead::EnumerateItems ( std::optional< imgdoc2::dbIndex >  parent,
bool  recursive,
DocumentMetadataItemFlags  flags,
const std::function< bool(imgdoc2::dbIndex, const DocumentMetadataItem &item)> &  func 
)
pure virtual

Enumerate items for which the specified node 'parent' is the ancestor. If recursive is false, then only the direct children of the specified parent are enumerated. If recursive is true, then all descendants of the specified parent are enumerated. If the specified parent is not valid (nullopt), then all items are enumerated. If the specified parent is valid, but does not exist, an exception of type imgdoc2::non_existing_item_exception is thrown.

Parameters
parentThe parent node for which the children are to be enumerated. If nullopt, then all items are enumerated.
recursiveFalse to enumerate only the direct children of the specified parent, true to enumerate all descendants of the specified parent.
flagsThe flags.
funcThe items found are reported to this function. If it returns false, the enumeration is stopped.

◆ EnumerateItemsForPath()

virtual void imgdoc2::IDocumentMetadataRead::EnumerateItemsForPath ( const std::string &  path,
bool  recursive,
DocumentMetadataItemFlags  flags,
const std::function< bool(imgdoc2::dbIndex, const DocumentMetadataItem &item)> &  func 
)
pure virtual

Enumerate items below the specified path. If recursive is false, then only the direct children of the specified path are enumerated. If recursive is true, then all descendants of the specified parent are enumerated. If the path is empty, then all items are enumerated. If the specified path does not exist, an exception of type imgdoc2::invalid_path_exception is thrown.

Parameters
pathThe path of the parent.
recursiveFalse to enumerate only the direct children of the specified parent, true to enumerate all descendants of the specified parent.
flagsThe flags.
funcThe items found are reported to this function. If it returns false, the enumeration is stopped.

◆ GetItem()

virtual imgdoc2::DocumentMetadataItem imgdoc2::IDocumentMetadataRead::GetItem ( imgdoc2::dbIndex  primary_key,
DocumentMetadataItemFlags  flags 
)
pure virtual

Get the item identified by the specified key. The argument 'flags' specifies which pieces of information should be retrieved. Only the information specified in the flags can be expected to be valid in the returned DocumentMetadataItem. If the item does not exist, an exception of type imgdoc2::non_existing_item_exception is thrown.

Parameters
primary_keyThe key of the metadata item to be retrieved.
flagsThe flags.
Returns
The item.

◆ GetItemForPath()

virtual imgdoc2::DocumentMetadataItem imgdoc2::IDocumentMetadataRead::GetItemForPath ( const std::string &  path,
imgdoc2::DocumentMetadataItemFlags  flags 
)
pure virtual

Get the item identified by the specified path. The argument 'flags' specifies which pieces of information should be retrieved. Only the information specified in the flags can be expected to be valid in the returned DocumentMetadataItem. If the path does not exist or is invalid, an exception of type imgdoc2::invalid_path_exception is thrown.

Parameters
pathThe path of the item to be retrieved.
flagsThe flags.
Returns
The item.

The documentation for this class was generated from the following file: