Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.

DBFormatInitialization
(informal protocol)


Category Of: Object
Declared In: dbkit/types.h



Category Description

This category is the companion of the category DBFormatConversion.  The two provide part of the mechanism the Database Kit uses to transfer Objective C objects between the database and the application.  DBFormatInitialization provides a method that specifies the format of the data contained in a buffer that the adaptor uses while reading data from the database.  You'll need explicit use of these methods only if your application uses formats other than those already supported in the Database Kit.  (The kit supports any object in the archive format appropriate to its class, as well as NXData using RTF format, or NXImage using TIFF or EPS format.)



Instance Methods

initFromBuffer:ofLength:withFormat:
initFromBuffer:(void *)buffer
ofLength:(unsigned)length
withFormat:(const char *)aFormatName

If your application creates a custom class that's associated with a property and your class implements this method, this method will be invoked automatically when the Database Kit tries to read data from the database for delivery as an instance of your class.

The argument buffer is an already allocated buffer, and length describes the buffer's length.

The argument aFormatName is a string containing the name of the format in which the data is written.  The Database Kit defines the following names for formats:

"EPS"
"RTF"
"TIFF"

Alternatively, the string may be the name of any type your application recognizes, as declared in DBModeler's Attribute Inspector for data of type Object.