2.2.4.13.6 Folder::Folder

Description

Default folder constructor


Folder Copy Constructor


Construct a folder using path

Syntax

Folder( )


Folder( Folder & folder )


Folder( LPCSTR lpcszPathName )

Parameters

folder
[input] Folder class object


lpcszPathName
[input] Folder path

Return

Examples

EX1

// This example constructs a folder by adding a subfolder named MyFolder to the root level folder.
// If the folder name exists, an enumerated folder is created
void Folder_Folder_Ex3()
{
    Folder fldRoot;
    fldRoot = Project.RootFolder;
    fldRoot.AddSubfolder("MyFolder");
}


EX2

// This example illustrates use of a copy constructor. Folder fldRoot and fldRootpp both refer to the root.
// Run in debug to watch the creation and destruction of "MyFolder2".
void Folder_Folder_Ex4()
{
    Folder fldRoot;
    fldRoot = Project.RootFolder;
    fldRoot.AddSubfolder("MyFolder1");
    fldRoot.AddSubfolder("MyFolder2");
        
    Folder fldRootpp(fldRoot);
    fldRootpp.RemoveSubFolder("MyFolder2");
}


EX3

// This example creates folders based on a path (here : root or '/')
// and creates a subfolder based on the new path
// Note that this method could misbehave as explained in Folder_Folder_Ex3
void Folder_Folder_Ex5()
{    
    Folder fldRoot("/");    // This folder always exists
    fldRoot.AddSubfolder("MyFolder");
    Folder fldMyFolder("/MyFolder");
    fldMyFolder.AddSubfolder("MySubFolder");
}

Remark

Construct a Folder object by pathname.

See Also

Header to Include

origin.h