Creating a Metadata Client Utility

This tutorial describes how to get started with the metadata client utility.

Purpose

The purpose of this tutorial is to show you how to create a new metadata client utility and select a suitable parser plug-in load option.

Required Background

The Metadata Utility Library Overview introduces the metadata client utility.

Introduction

To start using the metadata utility, an instance of CMetaDataClientUtility must be created using the CMetaDataClientUtility::NewL() function. Two overloads of NewL are provided which offer different options for loading parser plug-ins. The following parser plug-in load options are available to the client application:

  • EAllPlugIns - load all the parsers at framework start-up time and close them when the metadata utility exits.

  • ESelectedPlugIns - load the most commonly used parsers and load the remaining parsers on demand.

    Note: If a client wants to load its own selection of parsers, then it can create an array of UIDs and pass that array to the metadata utility using the (const RPointerArray<TUid>& aSelectedParsers) parameter.

  • EOnDemandPlugIn - do not load any parsers at framework start-up time; load all parsers on demand.

Using the Metadata Client Utility

The following tasks will be covered in this tutorial:

  • Create a metadata client utility object

Basic Procedure

Create a new metadata utility object using one of the two overloads:

Note: The client application owns the metadata utility object. When the client application completes all metadata extractions and exits from the MUF, it must delete the utility object instance.

Example

//Create a new utility object (utility)
//which loads all parsers on framework start-up

CMetaDataClientUtility* utility = CMetaDataClientUtility::NewL(EAllPlugIns);