VCOM:VectorWorks:Filing:IFolderIdentifier::EnumerateContents

From Vectorworks Developer
Jump to navigation Jump to search

.SDK|SDK ..SDK:Types|SDK Types ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Description

namespace VectorWorks::Filing

Member of VCOM:VectorWorks:Filing:IFolderIdentifier

Enumerate the content of this folder. Can perform reqursive enumerations also.

virtual VCOMError VCOM_CALLTYPE EnumerateContents(
IFolderContentListener* pListener,
bool bReqursive) = 0;

Parameters

pListener IFolderContentListener* Class that will receive the contents of the folders during enumeration.
bReqursive bool True if the routine should perform reqursive enumeration of the sub folders.

Return Value

Uses standard VCOM Error Reporting.

Return value meaning:

kVCOMError_NotInitialized Bad VCOM instance used to call the fuction.
kVCOMError_InvalidArg The passed listener is invalid, probably NULL.
kVCOMError_BadPathSpecified This folder path is invalid.
kVCOMError_FileNotFound This folder does not exist on disk.
kVCOMError_Failed The enumeration has been stopped with error.
kVCOMError_NoError The enumeration has finished or have been stopped without error.

Remarks

For the enumeration call you need to create instance of the interface IFolderContentListener.

Thourh the virtual funtions the enumeration routine will notify the user class for the folder contents.

class IFolderContentListener
{
public:
  virtual ~IFolderContentListener()		{}

  virtual EFolderContentListenerResult VCOM_CALLTYPE	OnFolderContent(IFolderIdentifier* pFolderID) = 0;
  virtual EFolderContentListenerResult VCOM_CALLTYPE	OnFileContent(IFileIdentifier* pFileID) = 0;
};

The content listener can decide to continue or to stop the process of enumerating though the return result from the listeners virtual functions:

enum EFolderContentListenerResult
{
    eFolderContentListenerResult_Continue,
    eFolderContentListenerResult_StopNoError,
    eFolderContentListenerResult_StopError,
};

Example

For example see VCOM:Enumerating folder contents article.

See Also

VCOM:VectorWorks:Filing:IFolderIdentifier

VCOM:Enumerating folder contents

[[VCOM:VectorWorks:Filing:IFolderIdentifier]] [[VCOM:Enumerating folder contents]]