The interface for read-only access to document metadata.
More...
#include <IDocumentMetadata.h>
|
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 |
|
IDocumentMetadataRead & | operator= (const IDocumentMetadataRead &)=delete |
|
| IDocumentMetadataRead (IDocumentMetadataRead &&)=delete |
|
IDocumentMetadataRead & | operator= (IDocumentMetadataRead &&)=delete |
|
| IDocumentMetadata (const IDocumentMetadata &)=delete |
|
IDocumentMetadata & | operator= (const IDocumentMetadata &)=delete |
|
| IDocumentMetadata (IDocumentMetadata &&)=delete |
|
IDocumentMetadata & | operator= (IDocumentMetadata &&)=delete |
|
|
typedef std::variant< std::string, std::int32_t, double, std::monostate > | metadata_item_variant |
| Defines an alias representing the metadata item variant. This variant can contain a string, an int32, a double or a std::monostate.
|
|
The interface for read-only access to document metadata.
◆ 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
-
parent | The parent node for which the children are to be enumerated. If nullopt, then all items are enumerated. |
recursive | False to enumerate only the direct children of the specified parent, true to enumerate all descendants of the specified parent. |
flags | The flags. |
func | The 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
-
path | The path of the parent. |
recursive | False to enumerate only the direct children of the specified parent, true to enumerate all descendants of the specified parent. |
flags | The flags. |
func | The items found are reported to this function. If it returns false, the enumeration is stopped. |
◆ GetItem()
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_key | The key of the metadata item to be retrieved. |
flags | The 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
-
path | The path of the item to be retrieved. |
flags | The flags. |
- Returns
- The item.
The documentation for this class was generated from the following file: