Mac Developer Library

Developer

CoreServices Framework Reference Metadata Importer Reference

Options
Deployment Target:

On This Page

Metadata Importer Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import CoreServices;

An MDImporter is responsible for returning the metadata contained with a file. The Spotlight server is notified when a file is changed and loads the appropriate importer to extract the metadata. An importer is implemented as a CFPlugin.

Callbacks

  • Defines a pointer to an importer import callback that imports importers.

    Declaration

    Objective-C

    typedef Boolean (* ImporterImportData) ( void *thisInterface, CFMutableDictionaryRef attributes, CFStringRef contentTypeUTI, CFStringRef pathToFile )

    Parameters

    thisInterface

    The CFPlugin object that is called. This value is passed to the callback function.

    attributes

    A mutable dictionary that you should populate with the metadata key/value pairs. This dictionary is created and passed to the callback function.

    contentTypeUTI

    The content type of the file as a uniform type identifier. This value is passed to the callback function.

    pathToFile

    The full path to the file. This value is passed to the callback function.

    Return Value

    Your callback function should return true if the metadata was successfully returned, false if the metadata was not returned.

Constants

  • Type ID of an importer plug-in.

    Declaration

    Objective-C

    #define kMDImporterTypeID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0x8B, 0x08, 0xC4, 0xBF, 0x41, 0x5 B, 0x11, 0xD8, 0xB3, 0xF9, 0x00, 0x03, 0x93, 0x67, 0x26, 0xFC);

    Constants

    • kMDImporterTypeID

      kMDImporterTypeID

      Only importers with this type ID are loaded.

      Available in OS X v10.4 and later.

    Discussion

    The string representation of this UUID is 8B08C4BF-415B-11D8-B3F9-0003936726FC.

  • Interface required by a importer plug-in.

    Declaration

    Objective-C

    #define kMDImporterInterfaceID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0x6E, 0xBC, 0x27, 0xC4, 0x89, 0x9 C, 0x11, 0xD8, 0x84, 0xAE, 0x00, 0x03, 0x93, 0x67, 0x26, 0xFC);

    Constants

    • kMDImporterInterfaceID

      kMDImporterInterfaceID

      Importers must implement an interface corresponding to this UUID.

      Available in OS X v10.4 and later.

    Discussion

    The string representation of this UUID is 6EBC27C4-899C-11D8-84A3-0003936726FC.