Next Page > Hide TOC

MDSchema Reference

Framework
CoreServices/CoreServices.h
Companion guide
Declared in
MDSchema.h

Overview

The MDSchema functions provide information about the metadata returned for an item including the type of metadata provided for a file type, the localized display name for a metadata attribute key, and the schema for a metadata attribute key.

Functions

MDSchemaCopyAllAttributes

Returns an array containing all the metadata attributes defined in the schema.

CFArrayRef MDSchemaCopyAllAttributes (
   void
);

Availability
Declared In
MDSchema.h

MDSchemaCopyAttributesForContentType

Returns a dictionary containing the metadata attributes for the specified UTI type.

MD_BEGIN_C_DECLS CFDictionaryRef MDSchemaCopyAttributesForContentType (
   CFStringRef contentTypeUTI
);

Parameters
utiType

The UTI type.

Return Value

A dictionary containing kMDAttributeDisplayValues and kMDAttributeAllValues keys. Returns NULL if the UTI type is unknown.

Discussion

This function returns the metadata attributes for the specified UTI type only.

Availability
Declared In
MDSchema.h

MDSchemaCopyDisplayDescriptionForAttribute

Returns the localized description of a metadata attribute key.

CFStringRef MDSchemaCopyDisplayDescriptionForAttribute (
   CFStringRef name
);

Parameters
name

The name of the metadata attribute key.

Return Value

The localized description of the metadata attribute, or NULL if no localized description is available.

Availability
Declared In
MDSchema.h

MDSchemaCopyDisplayNameForAttribute

Returns the localized display name of a metadata attribute key.

CFStringRef MDSchemaCopyDisplayNameForAttribute (
   CFStringRef name
);

Parameters
name

The name of the metadata attribute key.

Return Value

The localized display name of the metadata attribute, or NULL if no localized display name is available.

Availability
Declared In
MDSchema.h

MDSchemaCopyMetaAttributesForAttribute

Returns a dictionary describing the values for the specified metadata attribute key.

CFDictionaryRef MDSchemaCopyMetaAttributesForAttribute (
   CFStringRef name
);

Parameters
name

The name of the metadata attribute key.

Return Value

A dictionary describing the schema of the metadata attribute key.

Availability
Declared In
MDSchema.h

Constants

Available Metadata Attribute Keys

Specify the available metadata attribute keys for a content type.

const CFStringRef kMDAttributeDisplayValues;
const CFStringRef kMDAttributeAllValues;

Constants
kMDAttributeDisplayValues

An array of strings containing the available display metadata attribute keys, or NULL if the type is not known by the system.

Available in Mac OS X v10.4 and later.

Declared in MDSchema.h.

kMDAttributeAllValues

An array of strings containing available the metadata attribute keys, or NULL if the type is not known by the system.

Available in Mac OS X v10.4 and later.

Declared in MDSchema.h.

Discussion

These keys are in the dictionary returned by the function MDSchemaCopyAttributesForContentType.

Availability

Metadata Attribute Schema Description Keys

Specify the schema of a metadata attribute key.

const CFStringRef kMDAttributeName;
const CFStringRef kMDAttributeType;
const CFStringRef kMDAttributeMultiValued;

Constants
kMDAttributeName

A string containing the name of the metadata attribute key.

Available in Mac OS X v10.4 and later.

Declared in MDSchema.h.

kMDAttributeType

A CFNumberRef or CFTypeId describing the type of data returned as the value of the metadata attribute key.

Available in Mac OS X v10.4 and later.

Declared in MDSchema.h.

kMDAttributeMultiValued

A boolean that indicates if the metadata attribute value is multi-valued. If this is TRUE, the metadata attribute value is an array of the types specified in kMDAttributeType.

Available in Mac OS X v10.4 and later.

Declared in MDSchema.h.

Discussion

These keys are in the dictionary returned by the function MDSchemaCopyMetaAttributesForAttribute.

Availability


Next Page > Hide TOC


© 2004, 2005 Apple Computer, Inc. All Rights Reserved. (Last updated: 2005-04-29)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.