MF Developer's Guide
MF Interfaces | MF Methods | MF Types and Misc API

IMoaPathName

Interface ID: IID_IMoaPathName
Pointer type: PIMoaPathName
Inheritance: IMoaUnknown
Header file: moapath.h

Description

The IMoaPathName interface provides various methods for the manipulation of pathnames.

Methods

InitFromString()
SetTempPath()
Resolve()
RemoveFinal()
AddFinal()
Concat()
SetVolumeName()
SetExtension()
SetScheme()
SetHostName()
SetPort()
SetUserID()
SetPassword()
SetParameters()
SetAnchor()
GetPath()
GetDisplayPath() not implemented in Director
GetDisplayFileName()
GetVolumeName()
GetExtension()
GetScheme()
GetHostName()
GetPort()
GetUserID()
GetPassword()
GetParameters()
GetAnchor()
IsEmpty()
IsAbsolute()
IsRelative()
IsCanonical()
AreEqual()
GetParentDirectory()
GetWorkingDirectory()
GetRelativePath() not implemented in Director
Clone()
InitFromFSSpec()

AddFinal()

Syntax

AddFinal(PMoaChar pFinalComponent)

Parameters

pFinalComponent
new path component

Returns

kMoaErr_NoErrSuccess

Description

Adds the string passed in to the current pathname. The string can be either a directory or filename.

AreEqual()

Syntax

AreEqual(PIMoaPathName pIMoaPathName)

Parameters

pIMoaPathName
pointer to an IMoaPathName instance

Returns

MoaBoolParam

Description

Returns TRUE if the provided IMoaPathName instance is the same as the current instance.

Clone()

Syntax

Clone(PIMoaPathName * ppIMoaPathName)

Parameters

ppIMoaPathName
on return contains a pointer to an IMoaPathName

Returns

kMoaErr_NoErrSuccess or standard MOA QueryInterface errors

Description

Creates an IMoaPathName instance identical to the current instance. The client is responsible for releasing this interface when done.

Concat()

Syntax

Concat(PIMoaPathName pIMoaPathName)

Parameters

pIMoaPathName
pointer to an IMoaPathName instance

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument

Description

Concatenates the pathname of the current instance with the instance passed in via pIMoaPathName.

GetAnchor()

Syntax

GetAnchor(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
buffer for returned anchor

nameBufSize
size of buffer

Returns

kMoaErr_NoErr Success
kMoaPathErr_UnsupportedForCurrentDialect Not supported for current dialect

Description

Returns the anchor component of the current pathname. This method has no effect on non-URL_STYLE paths.

GetDisplayFileName()

Syntax

GetDisplayFileName(PMoaChar pNameBuf, MoaLong nameBufSize, MoaBoolParam bForMenu)

Parameters

pNameBuf
buffer for the returned filename

nameBufSize
length of buffer

bForMenu
for menu flag

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument

Description

Returns the display filename for the current pathName. The display filename is formatted to properly fit within the buffer supplied. If the entire fileName cannot be fit in to the buffer, it is re-formatted. Example:
foo.txt may become foo
The bForMenu menu boolean tells the method whether or not the path is going to be used within a menu, in which case, the formatting is altered.

GetDisplayPath()

Syntax

GetDisplayPath(PMoaChar pNameBuf, MoaLong nameBufSize, MoaBoolParam bForMenu)

Parameters

pNameBuf
pointer to buffer for returned path

nameBufSize
size of buffer

bForMenu
for menu flag

Returns

kMoaErr_NotImplemented No implementation for this method in Director

Description


GetExtension()

Syntax

GetExtension(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
buffer for the returned extension

nameBufSize
size of the buffer

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument

Description

Returns the extension of the current file.

GetHostName()

Syntax

GetHostName(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
buffer for the returned hostname

nameBufSize
size of buffer

Returns

kMoaErr_NoErr Success
kMoaPathErr_UnsupportedForCurrentDialect Not supported for current dialect

Description

Returns the hostname component of the current pathname. This method has no effect on non-URL_STYLE paths.

GetParameters()

Syntax

GetParameters(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
buffer for returned parameters

nameBufSize
size of buffer

Returns

kMoaErr_NoErr Success
kMoaPathErr_UnsupportedForCurrentDialect Not supported for current dialect

Description

Returns user defined components of the current pathname. This method has no effect on non-URL_STYLE paths.

GetParentDirectory()

Syntax

GetParentDirectory(PIMoaPathName * ppIMoaPathName)

Parameters

ppIMoaPathName
on return contains a pointer to an IMoaPathName reference

Returns

kMoaErr_NoErr Success or standard MOA QueryInterface errors

Description

Returns a PIMoaPathName object that references the current instance's parent directory. The client is responsible for releasing this interface when done.

GetPassword()

Syntax

GetPassword(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
buffer for returned password

nameBufSize
size of buffer

Returns

kMoaErr_NoErr Success
kMoaPathErr_UnsupportedForCurrentDialect Not supported for current dialect

Description

Returns the password component of the current pathname. This method has no effect on non-URL_STYLE paths.

GetPath()

Syntax

GetPath(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
pointer to buffer for returned path

nameBufSize
size of buffer

Returns

kMoaErr_NoErr Success

Description

Returns a pointer to a string containing the current pathname.

GetPort()

Syntax

GetPort(MoaLong * pPortNumber)

Parameters

pPortNumber
on return contains port number

Returns

kMoaErr_NoErr Success
kMoaPathErr_UnsupportedForCurrentDialect Not supported for current dialect

Description

Returns the port component of the current pathname. This method has no effect on non-URL_STYLE paths.

GetRelativePath()

Syntax

GetRelativePath(PIMoaPathName pToPath, PIMoaPathName * ppRelPath)

Parameters

pToPath
pointer to the desination path
ppRelPath
on return contains a pointer to an IMoaPathName object

Returns

kMoaErr_NotImplemented No implementation for this method in Director

Description


GetScheme()

Syntax

GetScheme(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
buffer for the returned scheme

nameBufSize
size of buffer

Returns

kMoaErr_NoErr Success
kMoaPathErr_UnsupportedForCurrentDialect Not supported for current dialect

Description

Returns the scheme component of the current pathname. This method has no effect on non-URL_STYLE paths.

GetUserID()

Syntax

GetUserID(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
buffer for returned UserID

nameBufSize
size of buffer

Returns

kMoaErr_NoErr Success
kMoaPathErr_UnsupportedForCurrentDialect Not supported for current dialect

Description

Returns the userID component of the current pathname. This method has no effect on non-URL_STYLE paths.

GetVolumeName()

Syntax

GetVolumeName(PMoaChar pNameBuf, MoaLong nameBufSize)

Parameters

pNameBuf
buffer for the returned volume name

nameBufSize
size of the buffer

Returns

kMoaErr_NoErr Success

Description

Returns the volume name of the current pathname.

GetWorkingDirectory()

Syntax

GetWorkingDirectory(PIMoaPathName * ppIMoaPathName)

Parameters

ppIMoaPathName
on return contains a pointer to an IMoaPathName object

Returns

kMoaErr_NoErr Success or standard MOA QueryInterface errors

Description

Returns a PIMoaPathName that references the current working directory. The client is responsible for releasing this interface when done.

InitFromFSSpec()

Syntax

InitFromFSSpec(ConstPMoaVoid pFSSpec)

Parameters

pFSSpec
pointer to Macintosh FSSpec

Returns

kMoaErr_NoErr Success

Description

Initializes the current instance from a Macintosh FSSpec.

InitFromString()

Syntax

InitFromString(ConstPMoaChar pFileName, MoaPathDialect pathDialect, MoaBoolParam bResolve, MoaBoolParam bUseDialog)

Parameters

pFileName
pointer to file name string

pathDialect
path dialect

bResolve
resolve flag

bUseDialog
use dialog flag

Returns

kMoaErr_NoErr Success

Description

InitFromString() intializes the current IMoaPathName object from a path string. The pathDialect flag tells the object what the style of the supplied path is. Valid dialects are: If LOCAL dialect is specified, InitFromString() will check if the supplied path is a URL or canonical pathname, if so the dialect will changed as such. The bResolve flag determines whether or not a relative path or leaf should be resolved into a fully qualified pathname. The bUseDialog flag determines whether or not the host app should use a dialog to resolve a path/file that cannot be located. bUseDialog is not likely to be supported outside Director's implementation.

IsAbsolute()

Syntax

IsAbsolute()

Parameters

Returns

MoaBoolParam

Description

Returns TRUE if the current path is absolute.

IsCanonical()

Syntax

IsCanonical()

Parameters

Returns

MoaBoolParam

Description

Returns TRUE if the current path is canonical.

IsEmpty()

Syntax

IsEmpty()

Parameters

Returns

MoaBoolParam

Description

Returns TRUE if the current path is empty.

IsRelative()

Syntax

IsRelative()

Parameters

Returns

MoaBoolParam

Description

Returns TRUE if the current path is relative.

IsValid()

Description

Do not call this method.

RemoveFinal()

Syntax

RemoveFinal()

Parameters

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument

Description

Removes the final component of the current pathname.

Resolve()

Syntax

Resolve(MoaBoolParam bUseDialog)

Parameters

bUseDialog
use dialog flag

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaErr_NotImplemented Environment does not support UseDialog

Description

Resolves the current instance into a fully qualifed path. If the bUseDialog flag is set, the host app provides a dialog when the target cannot be found. bUseDialog is not likely to be supported outside Director's implementation. The bUseDialog feature is no longer supported in Director. If you pass in TRUE for this value, you will get an error return from this call.

SetAnchor()

Syntax

SetAnchor(ConstPMoaChar pNameBuf)

Parameters

pNameBuf
buffer containing anchor

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaPathErr_UnsupportedForCurrentDialect Not supported by current dialect

Description

Sets the anchor component of the current URL_STYLE pathname. This method has no effect on non URL_STYLE pathnames.

SetExtension()

Syntax

SetExtension(ConstPMoaChar pNameBuf)

Parameters

pNameBuf
buffer containing the extension

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument

Description

Sets the extension of the current filename.

SetHostName()

Syntax

SetHostName(ConstPMoaChar pNameBuf)

Parameters

pNameBuf
buffer containing the hostname

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaPathErr_UnsupportedForCurrentDialect Not supported by current dialect

Description

Sets the hostname component of the current URL_STYLE pathname. This method has no effect on non URL_STYLE pathnames.

SetParameters()

Syntax

SetParameters(ConstPMoaChar pNameBuf)

Parameters

pNameBuf
buffer containing user defined parameters

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaPathErr_UnsupportedForCurrentDialect Not supported by current dialect

Description

Sets any miscelleaneous components of the current URL_STYLE pathname. This method has no effect on non URL_STYLE pathnames.

SetPassword()

Syntax

SetPassword(ConstPMoaChar pNameBuf)

Parameters

pNameBuf
buffer containing the password

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaPathErr_UnsupportedForCurrentDialect Not supported by current dialect

Description

Sets the password component of the current URL_STYLE pathname. This method has no effect on non URL_STYLE pathnames.

SetPort()

Syntax

SetPort(MoaLong portNumber)

Parameters

portNumber
MoaLong specifying the port number

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaPathErr_UnsupportedForCurrentDialect Not supported by current dialect

Description

Sets the port component of the current URL_STYLE pathname. This method has no effect on non URL_STYLE pathnames.

SetScheme()

Syntax

SetScheme(ConstPMoaChar pNameBuf)

Parameters

pNameBuf
buffer containing the URL scheme

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaPathErr_UnsupportedForCurrentDialect Not supported by current dialect

Description

Sets the scheme component of the current URL_STYLE pathname. This method has no effect on non URL_STYLE pathnames.

SetTempPath()

Syntax

SetTempPath(PIMoaPathName pIDir)

Parameters

pIDir
you must pass in NULL for this argument

Returns

kMoaErr_NoErr Success
kMoaErr_FileNotFound File not found

Description

Determines a unique name for a temporary file and replaces the current value of the pathname instance with that name. This routine does not actually create the file.

SetUserID()

Syntax

SetUserID(ConstPMoaChar pNameBuf)

Parameters

pNameBuf
buffer containing the userID

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaPathErr_UnsupportedForCurrentDialect Not supported by current dialect

Description

Sets the user ID component of the current URL_STYLE pathname. This method has no effect on non URL_STYLE pathnames.

SetVolumeName()

Syntax

SetVolumeName(ConstPMoaChar pNameBuf)

Parameters

pNameBuf
string containing the new volume name

Returns

kMoaErr_NoErr Success
kMoaErr_BadParam You passed me a bogus argument
kMoaPathErr_UnsupportedForCurrentDialect Not supported by current dialect

Description

Used to set the volume name of the current pathname.

Copyright © 1995-2008 Adobe Macromedia Software LLC, Inc.