Functions



getBase

public:

virtual UInt64 getBase() const;

Ask the media object for its byte offset relative to its provider media object below it in the storage hierarchy. Media offset, in bytes.


getContent

public:

virtual const char * getContent() const;

Ask the media object for a description of its contents. The description is the same as the hint at the time of the object's creation, but it is possible that the description be overrided by a client (which has probed the media and identified the content correctly) of the media object. It is more accurate than the hint for this reason. The string is formed in the likeness of Apple's "Apple_HFS" strings. * The content description can be overrided by any client that matches onto this media object with a match category of kIOStorageCategory. The media object checks for a kIOMediaContentMask property in the client, and if it finds one, it copies it into kIOMediaContent property.

Result: Description of media's contents.

getContentHint

public:

virtual const char * getContentHint() const;

Ask the media object for a hint of its contents. The hint is set at the time of the object's creation, should the creator have a clue as to what it may contain. The hint string does not change for the lifetime of the object and is also formed in the likeness of Apple's "Apple_HFS" strings.

Result: Hint of media's contents.

getPreferredBlockSize

public:

virtual UInt64 getPreferredBlockSize() const;

Ask the media object for its natural block size. This information is useful to clients that want to optimize access to the media.

Result: Natural block size, in bytes.

getSize

public:

virtual UInt64 getSize() const;

Ask the media object for its total length in bytes.

Result: Media size, in bytes.

handleClose

protected:

virtual void handleClose(IOService * client, IOOptionBits options);

The handleClose method closes the client's access to this object. * This implementation replaces the IOService definition of handleClose().

Parameters

NameDescription
clientClient requesting the close.
optionsOptions for the close. Set to zero.

handleIsOpen

protected:

virtual bool handleIsOpen(const IOService * client) const;

The handleIsOpen method determines whether the specified client, or any client if none is specificed, presently has an open on this object. * This implementation replaces the IOService definition of handleIsOpen().

Parameters

NameDescription
clientClient to check the open state of. Set to zero to check the open state of all clients.
Result: Returns true if the client was (or clients were) open, false otherwise.

handleOpen

protected:

virtual bool handleOpen(IOService * client, IOOptionBits options, void * access);

The handleOpen method grants or denies permission to access this object to an interested client. The argument is an IOStorageAccess value that specifies the level of access desired -- reader or reader-writer. * This method can be invoked to upgrade or downgrade the access level for an existing client as well. The previous access level will prevail for upgrades that fail, of course. A downgrade should never fail. If the new access level should be the same as the old for a given client, this method will do nothing and return success. In all cases, one, singular close-per-client is expected for all opens-per-client received. * This implementation replaces the IOService definition of handleOpen().

Parameters

NameDescription
clientClient requesting the open.
optionsOptions for the open. Set to zero.
accessAccess level for the open. Set to kAccessReader or kAccessReaderWriter.
Result: Returns true if the open was successful, false otherwise.

init

public:

virtual bool init(UInt64 base, UInt64 size, UInt64 preferredBlockSize, bool isEjectable, bool isWhole, bool isWritable, const char * contentHint = 0, OSDictionary * properties = 0);

Initialize this object's minimal state.

Parameters

NameDescription
baseMedia offset, in bytes.
sizeMedia size, in bytes.
preferredBlockSizeNatural block size, in bytes.
isEjectableIndicates whether the media is ejectable.
isWholeIndicated whether the media represents the whole disk.
isWritableIndicates whether the media is writable.
contentHintHint of media's contents (optional). See getContentHint().
propertiesSubstitute property table for this object (optional).
Result: Returns true on success, false otherwise.

isEjectable

public:

virtual bool isEjectable() const;

Ask the media object whether it is ejectable.

Result: Returns true if the media is ejectable, false otherwise.

isFormatted

public:

virtual bool isFormatted() const;

Ask the media object whether it is formatted.

Result: Returns true if the media is formatted, false otherwise.

isWhole

public:

virtual bool isWhole() const;

Ask the media object whether it represents the whole disk.

Result: Returns true if the media represents the whole disk, false otherwise.

isWritable

public:

virtual bool isWritable() const;

Ask the media object whether it is writable.

Result: Returns true if the media is writable, false otherwise.

read

public:

virtual void read(IOService * client, UInt64 byteStart, IOMemoryDescriptor * buffer, IOStorageCompletion completion);

Read data from the storage object at the specified byte offset into the specified buffer, asynchronously. When the read completes, the caller will be notified via the specified completion action. * The buffer will be retained for the duration of the read.

Parameters

NameDescription
clientClient requesting the read.
byteStartStarting byte offset for the data transfer.
bufferBuffer for the data transfer. The size of the buffer implies the size of the data transfer.
completionCompletion routine to call once the data transfer is complete.

write

public:

virtual void write(IOService * client, UInt64 byteStart, IOMemoryDescriptor * buffer, IOStorageCompletion completion);

Write data into the storage object at the specified byte offset from the specified buffer, asynchronously. When the write completes, the caller will be notified via the specified completion action. * The buffer will be retained for the duration of the write.

Parameters

NameDescription
clientClient requesting the write.
byteStartStarting byte offset for the data transfer.
bufferBuffer for the data transfer. The size of the buffer implies the size of the data transfer.
completionCompletion routine to call once the data transfer is complete.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)