VCOM:VectorWorks:Filing:IFolderIdentifier

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

Description

namespace VectorWorks::Filing

Instance of this interface represent one folder in the OS.

The folder is not required to exist for the instance to exist.

Interface

// ----------------------------------------------------------------------------------------------------
// {C06DFE83-3791-11DB-9C35-00508D5E9851}
static const VWIID IID_FolderIdentifier = { 0xC06DFE83, 0x3791, 0x11DB, { 0x9C, 0x35, 0x00, 0x50, 0x8D, 0x5E, 0x98, 0x51 } };

class IFolderIdentifier : public IVWUnknown
{
public:
  virtual VCOMError VCOM_CALLTYPE Set(const TXString& fullPath) = 0;
  virtual VCOMError VCOM_CALLTYPE Set(EFolderSpecifier folderSpec, bool bUserFolder) = 0;
  virtual VCOMError VCOM_CALLTYPE Set(EFolderSpecifier folderSpec, bool bUserFolder, const TXString& subFolderName) = 0;
  virtual VCOMError VCOM_CALLTYPE Set(IFolderIdentifier* pParentFolder, const TXString& folderName) = 0;
  virtual VCOMError VCOM_CALLTYPE Clear() = 0;
  virtual VCOMError VCOM_CALLTYPE IsSet() = 0;
  virtual VCOMError VCOM_CALLTYPE ExistsOnDisk(bool& outValue) = 0;
  virtual VCOMError VCOM_CALLTYPE GetFullPath(TXString& outPath, ETXStringEncoding txEncoding = eDefaultPathEncoding) = 0;
  virtual VCOMError VCOM_CALLTYPE GetName(TXString& outName) = 0;
  virtual VCOMError VCOM_CALLTYPE GetParentFolder(IFolderIdentifier** ppOutParentFolderID) = 0;
  virtual VCOMError VCOM_CALLTYPE GetAttributes(SAttributes& outAttributes) = 0;
  virtual VCOMError VCOM_CALLTYPE SetAttributes(const SAttributes& attributes) = 0;
  virtual VCOMError VCOM_CALLTYPE EnumerateContents(IFolderContentListener* pListener, bool bReqursive) = 0;
  virtual VCOMError VCOM_CALLTYPE CreateOnDisk() = 0;
  virtual VCOMError VCOM_CALLTYPE DeleteOnDisk() = 0;
  virtual VCOMError VCOM_CALLTYPE RevealInOS() = 0;
  virtual VCOMError VCOM_CALLTYPE DuplicateOnDisk(IFolderIdentifier * newFolder, bool overrideIfNecessary = false, TXString* displayProgressDialog = NULL) = 0;
  virtual VCOMError VCOM_CALLTYPE FormatFoldername(TXString& formatName, Uint16 maxCharsWithoutSpace) = 0;
};

Members

Set Set folder definition.
Clear Clear this folder path. This makes the instance contain folder with illegal path.
IsSet Determines if this folder identifier is set.
ExistsOnDisk Determines if the folder exist on the disk.
GetFullPath Get full path of the folder. In VW 2016, you can provide the optional encoding parameter. The default encoding on Mac is UTF8, on Windows is language-specific Windows encoding. ETXStringEncoding enum class is defined in "GSString.X.h".
GetName Get the name of this folder.
GetParentFolder Get parent folder of this folder.
GetAttributes Get the attributes of this folder.
SetAttributes Set the attributes of this folder.
EnumerateContents Enumerate the content of this folder.
CreateOnDisk Create this folder on the disk.
DeleteOnDisk Delete this folder from the disk.
RevealInOS Show in finder for Mac and show in explorer for windows.
DuplicateOnDisk Duplicated this folder into another on the dist.
FormatFoldername Prepares folder name string with specified length. Adds '...' if the file name is longer than requested.
ValidateName <needs info>

Remarks

You should use Set members first to specify the instance's folder. There are VectorWorks predefined folders which can be accessed through the enumeration values from EFolderSpecifier provided by the SDK in file 'FolderSpecifiers.h'

The most common used values are:

kApplicationFolder
kExternalsFolder

There is predefined type for smart VCOM pointer VCOMPtr to IFolderIdentifier:

typedef VCOMPtr< IFolderIdentifier >  IFolderIdentifierPtr;

Example

Create an instance and set it to refer to particular folder inside Plug-ins folder:

using namespace VectorWorks::Filing;

VCOMPtr< IFolderIdentifier >  pMyFolder( IID_FolderIdentifier );
if ( pMyFolder && VCOM_SUCCEEDED( pMyFolder->Set( kExternalsFolder, "MyFolder" ) ) {
   // ...
}

Version

Available from: VectorWorks 12

See Also

VCOM:VCOMPtr | VCOM:VectorWorks:Filing:IFolderChooserDialog | VCOM:VectorWorks:Filing:IFileIdentifier

[[VCOM:VCOMPtr]] | [[VCOM:VectorWorks:Filing:IFolderChooserDialog]] | [[VCOM:VectorWorks:Filing:IFileIdentifier]]