class P1::ImageSdk::MetaDataBase

Overview

#include <P1ImageCommonMetaData.hpp>

class MetaDataBase: public P1::ImageSdkC::P1MetaDataBase
{
public:
    // construction

    MetaDataBase(RawImage& image, bool useDbFromFile = false);

    // methods

    MetaObject GetMetaObject(std::string path);
    MetaObject CreateMetaObject(std::string path);
    bool Exist(std::string path);
    bool CreateXmpNamespace(std::string name, std::string url);
    void Dump();
};

Inherited Members

public:
    // methods

    P1MetaObject GetMetaObject(std::string path);
    P1MetaObject CreateMetaObject(std::string path);
    bool Exist(std::string path);
    bool CreateXmpNamespace(std::string name, std::string url);
    void Dump();
    CMetaDataDatabase* GetDb();

Detailed Documentation

Methods

MetaObject GetMetaObject(std::string path)

Retrieve a metadata object from the metadatabase.

A P1MetaData object will always be returned not matter if the metaobject was found or not. To chech the validity of the object the IsValid() method can be used. It is safe to nest both a GetMetaObject call with a getter or setter without checking for validity. If metaobject is not found then an error will just be returned by the getter or setter.

Parameters:

path

The path to the object. The metaobjects are orginized in a tree structure where each level of the tree is divided by a “:”

Returns:

a P1MetaObject. To check if an object was found can be checked with the IsValid() function. But it is safe to nest this function with a getter or setter.

MetaObject CreateMetaObject(std::string path)

Create a new metadata object and insert it in the metadatabase.

A P1MetaData object will always be returned not matter if function was able to create object or not. To chech the validity of the object the IsValid() method can be used. It is safe to nest a CreateMetaObject call with a getter or setter without checking for validity. But the final error code or return value should be tested for success.

Parameters:

path

The path to the object that the user wants to create. The metaobjects are orginized in a tree structure where each level of the tree is divided by a “:”. The last part of the path must be a unique name of the new object.

Returns:

a P1MetaObject. To check if an object was found can be checked with the IsValid() function. But it is safe to nest this function with a getter or setter.

bool Exist(std::string path)

Check for existance of a metaobject in the metadatabase.

Parameters:

path

The path to the object that the user wants to create. The metaobjects are orginized in a tree structure where each level of the tree is divided by a “:”. This function can also be used to check if a list of objects exist or not. Eg. a namespace in the xmp block.

Returns:

A boolean value that indicates if metaobject exist or not. true means it does exist.

bool CreateXmpNamespace(std::string name, std::string url)

Create a new Xmp namespace in an xmp block. This requires that an xmp block exist in the database.

For now it is only possible to create new lists of objects in the xmp block. Therefore the function refers only to the xmp block

Parameters:

name

The name of the new namespace.

url

The url for the xmp namespace.

Returns:

A boolean value that indicates if creation of the namespace was successfull or not.

void Dump()

A debug function for internal use.