MF II Developer's Guide
MF II Interfaces | MF II Methods


Director Xtra Development Kit: MOA File Access II API Reference

MOA File Access II Types and Miscellaneous API


This document contains the following sections:


Moa File Types

MoaFileEnumProc Prototype

typedef STDPROCPTR(STDMETHODCALLTYPE, MoaError, MoaFileEnumProc)(
        PIMoaPathName   pIMoaPathName,
        MoaBoolParam    isDirectory, 
        PMoaWide FAR *  pLastModDate,
        PMoaChar        pFileType,
        PMoaVoid        pClientData
);

Prototype for function passed to IMoaFile2::EnumFiles() method.

Defined in: moafile2.h

MoaPathDialect

MoaPathDialect

Argument specifying path name style in IMoaPathName::InitFromString(), with the following values:
kMoaPathDialect_LOCAL
kMoaPathDialect_CANON_STYLE Canonical style relative pathname
kMoaPathDialect_MAC_STYLE Macintosh style pathname.
kMoaPathDialect_DOS_STYLE MSDOS style pathname
kMoaPathDialect_UNIX_STYLE Unix style pathname.
kMoaPathDialect_URL_STYLE URL(RFC 1738) style pathname.

Defined in: moapath.h

MoaStreamIOOperation

MoaStreamIOOperation,
PMoaStreamIOOperation

Argument to IMoaStream2::ReadOperation() and IMoaStream2::WriteOperation() with the following fields:

typedef struct MoaStreamIOOperation
{
  /* inputs */
  MoaStreamCount              ioRequestCount;
  PMoaVoid                    pClientBuffer;
  MoaStreamIOFlags            ioFlags;
  MoaStream2IOCompletionProc  pCompletionProc;

  /* outputs */
  MoaError                    ioResult;
  MoaStreamCount              actualIOCount;
  PMoaVoid                    pStreamBuffer;

  /* both */
  PMoaVoid                    pClientData;
} MoaStreamIOOperation, FAR *PMoaStreamIOOperation;

Defined in: moastrm2.h

MoaStreamPositionMode

MoaStreamPositionMode

Argument to IMoaStream2::SetPositionRelative(), with the following values:

kMoaStreamPositionMode_FromStart
kMoaStreamPositionMode_FromCurrent
kMoaStreamPositionMode_FromEnd

Defined in: moastr2.h

MoaStreamIOFlags

MoaStreamIOFlags,
FAR *PMoaStreamIOFlags;

Argument to MoaStreamIOOperation::SetInputs()

Defined in: moastr2.h

MoaStream2IOCompletionProc

typedef STDPROCPTR(STDMETHODCALLTYPE, MoaError, MoaStream2IOCompletionProc)(
        PIMoaStreamIOOperation  pIStreamOp,
        PMoaVoid                pClientData
);

Argument to MoaStreamIOOperation::SetInputs()

Defined in: moastr2.h


Moa File Constants and Enumerations

Access values

kMoaFileAccessPerm_Read
kMoaFileAccessPerm_Write

Values returned by MoaFile2::GetAccess()

Defined in: moafile2.h

Initialization constants

kMoaPath_DontResolveOnInit
kMoaPath_ResolveOnInit

Argument to IMoaPathName::InitFromString()

Defined in: moapath.h

Resolve constants

kMoaPath_DontResolveWithDialog
kMoaPath_ResolveWithDialog

Argument to IMoaPathName::Resolve()

Defined in: moapath.h

ForMenu constants

kMoaPath_NotForMenu
kMoaPath_ForMenu

Argument to IMoaPathName::GetDisplayPath() and IMoaPathName::GetDisplayFileName()

Defined in: moapath.h


Stream IO flags

kMoaStreamIOFlag_UseAsyncIO
kMoaStreamIOFlag_UseBufferredIO

Defined in: moastr2.h

Moa File IO Attributes

These symbols represent categories of entry in the IMoaIoAttributes interface provided by IMoaFile2 and IMoaStream2 implementations.

Entry String Constants
#define kMoaIOKey_StreamFlags			"MIOKey_StreamFlags"
#define kMoaIOKey_StreamAccessMode		"MIOKey_StreamAccessMode"
#define kMoaIOKey_StreamBufferSize		"MIOKey_StreamBufferSize"
#define kMoaIOKey_StreamDataRate		"MIOKey_StreamDataRate"
#define kMoaIOKey_StreamEnd				"MIOKey_StreamEnd"
#define kMoaIOKey_StreamCurrentLength	"MIOKey_StreamCurrentLength"
#define kMoaIOKey_StreamPosition		"MIOKey_StreamPosition"
#define kMoaIOKey_StreamPositionType	"MIOKey_StreamPositionType"

#define kMoaIOKey_FileFlags				"MIOKey_FileFlags"
#define kMoaIOKey_FileAccessPerm		"MIOKey_FileAccessPerm"
#define kMoaIOKey_FileLength			"MIOKey_FileLength"
#define kMoaIOKey_FileType				"MIOKey_FileType"
#define kMoaIOKey_FileEncoding			"MIOKey_FileEncoding"
#define kMoaIOKey_FileCreator			"MIOKey_FileCreator"
#define kMoaIOKey_FileCreateDate		"MIOKey_FileCreateDate"
#define kMoaIOKey_FileModifyDate		"MIOKey_FileModifyDate"
#define kMoaIOKey_FileAccessDate		"MIOKey_FileAccessDate"
#define kMoaIOKey_FileCachePriority		"MIOKey_FileCachePriority"

#define kMoaIOKey_VolumeFlags			"MIOKey_VolumeFlags"
#define kMoaIOKey_VolumeBlockSize		"MIOKey_VolumeBlockSize"
#define kMoaIOKey_VolumeSectorSize		"MIOKey_VolumeSectorSize"
#define kMoaIOKey_VolumeFreeSpace		"MIOKey_VolumeFreeSpace"
Entry Index Enums
enum {
	kMoaIOKeyIndex_StreamFlags,
	kMoaIOKeyIndex_StreamAccessMode,
	kMoaIOKeyIndex_StreamBufferSize,
	kMoaIOKeyIndex_StreamDataRate,
	kMoaIOKeyIndex_StreamEnd,
	kMoaIOKeyIndex_StreamCurrentLength,
	kMoaIOKeyIndex_StreamPosition,
	kMoaIOKeyIndex_StreamPositionType,

	kMoaIOKeyIndex_FileFlags,
	kMoaIOKeyIndex_FileAccessPerm,
	kMoaIOKeyIndex_FileLength,
	kMoaIOKeyIndex_FileType,
	kMoaIOKeyIndex_FileEncoding,
	kMoaIOKeyIndex_FileCreator,
	kMoaIOKeyIndex_FileCreateDate,
	kMoaIOKeyIndex_FileModifyDate,
	kMoaIOKeyIndex_FileAccessDate,
	kMoaIOKeyIndex_FileCachePriority,

	kMoaIOKeyIndex_VolumeFlags,
	kMoaIOKeyIndex_VolumeBlockSize,
	kMoaIOKeyIndex_VolumeSectorSize,
	kMoaIOKeyIndex_VolumeFreeSpace,

	kMoaIOKeyIndex_LastPredefined
};

These entries represent specific capabilities of the implementation, as described in the following table.
Stream Attributes Type Size (bytes) Value
Flags PMoaLong 4 logical OR of 0 or more of:
kMoaStreamFlag_HasAsyncIO, kMoaStreamFlag_HasBufferredIO, kMoaStreamFlag_HasDirectBufferAccess
AccessMode PMoaLong 4 One of kMoaStreamOpenAccess_ReadOnly, kMoaStreamOpenAccess_ReadWrite, kMoaStreamOpenAccess_WriteOnly
BufferSize PMoaLong 4 Bytes
DataRate PMoaLong 4
End PMoaLong 4 Bytes
CurrentLength PMoaLong 4 Bytes
Position PMoaLong 4 Bytes
PositionType PMoaLong 4 One of kMoaStreamSetPositionType_None, kMoaStreamSetPositionType_Expensive, kMoaStreamSetPositionType_Cheap
File Attributes Type Size
(bytes)
Values
Flags PMoaLong 4 Logical OR of 0 or more of:
kMoaFileFlag_IsExistant,
kMoaFileFlag_IsDirectory
AccessPerm PMoaLong 4 One of kMoaFileAccessPerm_Read, kMoaFileAccessPerm_Write
Length PMoaLong 4 Bytes
Type PMoaChar N/A
Encoding PMoaChar N/A
Creator PMoaChar N/A
CreateDate PMoaWide 8
ModifyDate PMoaWide 8
AccessDate PMoaWide 8
CachePriority PMoaLong 4
Volume Attributes Type Size (bytes) Values
Flags PMoaLong 4 Logical OR of kMoaVolFlag_IsRemovable, kMoaVolFlag_IsCDROM, kMoaVolFlag_IsHardDisk, kMoaVolFlag_IsNetworkDrive
BlockSize PMoaLong 4 Bytes
SectorSize PMoaLong 4 Bytes
FreeSpace PMoaLong 4 Bytes

Defined in: mioattr.h


Moa File Error Codes

IMoaFile2 error codes

kMoaFileErr_IoError
kMoaFileErr_BufferTooSmall
kMoaFileErr_DuplicateSpec
kMoaFileErr_DiskFull
kMoaFileErr_FileBusy
kMoaFileErr_BadFileSpec

Defined in: moafile2.h

IMoaStream2 error codes
Code Error
kMoaStreamErr_DataNotAvail Non-blocking read: data hasn't yet arrived
kMoaStreamErr_OpNotDone Op hasn't finished, so results not avail
kMoaErr_AttrNoSuch IO Attrs: set/get of one which doesn't exist */
kMoaErr_AttrCantSet IO Attrs: not a settable attr
kMoaErr_AttrPastLast IO Attrs: off end (from GetFirst/NextSelector)
kMoaErr_ShMemLockError Sharedm memory: locked but shouldn't be; unlocked but should be
kMoaErr_CacheIncompatible Running at same time as an app with incompatible version of our cache
kMoaErr_CacheDownloadStopped Download: Transfer halted
kMoaErr_CacheWrongState Client made a cache call at a bad time
Defined in: moastr2.h