Retrieving Extended Field Information

This tutorial describes how to retrieve extended field information.

Purpose

The purpose of this tutorial is to show you how to retrieve extended field IDs and names.

Required Background

The Metadata Utility Library Overview introduces the metadata client utility.

Introduction

MUF provides the generic TMetaDatFieldId enum structure which represents the most common metadata fields. If device creators require additional metadata fields, they can add extended field information to the enum.

Extended field information is maintained in individual parser plug-ins. If a client needs to know a parser's extended field information, then the client can query for extended field information. The client receives a reference to an array of extended field objects.

The client can use extended field IDs when specifying the metadata fields it wants to extract. For more information, see Extracting the Metadata.

Using Extended Field Information

The following tasks will be covered in this tutorial:

  • Retrieve extended field information for a selected parser

  • Retrieve extended field information for any parser

Basic Procedure

The high level steps to retrieve extended field information for a selected parser are shown here:

  1. Create a new metadata utility object.

  2. Initialise the parser plug-in with an input source.

  3. Call CMetaDataClientUtility::ParserFieldExtensionsL() to retrieve extended field information for the loaded parser plug-in.

    IMPORT_C const RPointerArray<CFieldExtensionInfo>& ParserFieldExtensionsL ();

The high level steps to retrieve extended field information for any parser are shown here:

  1. Create a new metadata utility object.

  2. Call CMetaDataClientUtility::ParserFieldExtensionsL() and set aParserUid to the parser UID. MUF checks whether the requested parser is already loaded. If it is not already loaded, then MUF loads it.

    IMPORT_C const RPointerArray<CFieldExtensionInfo>& ParserFieldExtensionsL (TUid aParserUid);

Examples

//Create a new utility object (utility)
//Initialise the parser plug-in

utility->ParserFieldExtensionsL() 
//Retrieve extended field information for loaded parser

//Create a new utility object (utility)
//Initialise the parser plug-in

utility->ParserFieldExtensionsL(KAcmeParserPluginUid) 
//Retrieve extended field information for parser UID