Folder

Overview

Represents a folder. Provides information about the folders and its content, and ways to manipulate them.

Use case

You can use Folder class to work with individual folder:

var Folders: array of Folder := Folder.UserLocal.GetFolders;

for item in Folders do begin
  writeLn("Folder: " + item.Name);
  writeLn("Files:");
  try
    var Files := item.GetFiles;
    for file in Files do
      writeLn("  " + file.Name);
  except
    writeLn("Unable to get files from "+item.Name);
  end;
end;

Location

 

constructor

 

constructor(aPath: not nullable String)

 

Folder(String! aPath)

 

init(_ aPath: String)

 

Folder(String! aPath)

Parameters:

  • aPath:

Create (Folder, Boolean): Folder

 

class method Create(FolderName: Folder; FailIfExists: Boolean): Folder

 

static Folder Create(Folder FolderName, Boolean FailIfExists)

 

static func Create(_ FolderName: Folder, _ FailIfExists: Boolean) -> Folder

 

static Folder Create(Folder FolderName, Boolean FailIfExists)

Parameters:

  • FolderName:
  • FailIfExists:

Create (Boolean)  mapped

 

method Create(FailIfExists: Boolean)

 

void Create(Boolean FailIfExists)

 

func Create(_ FailIfExists: Boolean)

 

void Create(Boolean FailIfExists)

Parameters:

  • FailIfExists:

CreateFile  mapped

 

method CreateFile(FileName: String; FailIfExists: Boolean): File

 

File CreateFile(String FileName, Boolean FailIfExists)

 

func CreateFile(_ FileName: String, _ FailIfExists: Boolean) -> File

 

File CreateFile(String FileName, Boolean FailIfExists)

Parameters:

  • FileName:
  • FailIfExists:

CreateSubfolder  mapped

 

method CreateSubfolder(SubfolderName: String; FailIfExists: Boolean): Folder

 

Folder CreateSubfolder(String SubfolderName, Boolean FailIfExists)

 

func CreateSubfolder(_ SubfolderName: String, _ FailIfExists: Boolean) -> Folder

 

Folder CreateSubfolder(String SubfolderName, Boolean FailIfExists)

Parameters:

  • SubfolderName:
  • FailIfExists:

Delete (Folder)

 

class method Delete(FolderName: Folder)

 

static void Delete(Folder FolderName)

 

static func Delete(_ FolderName: Folder)

 

static void Delete(Folder FolderName)

Parameters:

  • FolderName:

Delete  mapped

 

method Delete

 

void Delete()

 

func Delete()

 

void Delete()

Exists (Folder): Boolean

 

class method Exists(FolderName: Folder): Boolean

 

static Boolean Exists(Folder FolderName)

 

static func Exists(_ FolderName: Folder) -> Boolean

 

static Boolean Exists(Folder FolderName)

Parameters:

  • FolderName:

Exists  mapped

 

method Exists: Boolean

 

Boolean Exists()

 

func Exists() -> Boolean

 

Boolean Exists()

Extension

 

property Extension: String read;

 

String Extension { get; }

 

var Extension: String { get{} }

 

String Extension { __get; }

FullPath

 

property FullPath: String read;

 

String FullPath { get; }

 

var FullPath: String { get{} }

 

String FullPath { __get; }

GetFile  mapped

 

method GetFile(FileName: String): File

 

File GetFile(String FileName)

 

func GetFile(_ FileName: String) -> File

 

File GetFile(String FileName)

Parameters:

  • FileName:

GetFiles (Folder, Boolean): not nullable List<File>

 

class method GetFiles(FolderName: Folder; aRecursive: Boolean): not nullable List<File>

 

static List<File>! GetFiles(Folder FolderName, Boolean aRecursive)

 

static func GetFiles(_ FolderName: Folder, _ aRecursive: Boolean) -> List<File>

 

static List<File>! GetFiles(Folder FolderName, Boolean aRecursive)

Parameters:

  • FolderName:
  • aRecursive:

GetFiles  mapped

 

method GetFiles: not nullable List<File>

 

List<File>! GetFiles()

 

func GetFiles() -> List<File>

 

List<File>! GetFiles()

GetFiles (Boolean): not nullable List<File>  mapped

 

method GetFiles(aRecursive: Boolean): not nullable List<File>

 

List<File>! GetFiles(Boolean aRecursive)

 

func GetFiles(_ aRecursive: Boolean) -> List<File>

 

List<File>! GetFiles(Boolean aRecursive)

Parameters:

  • aRecursive:

GetSubfolders (Folder): not nullable List<Folder>

 

class method GetSubfolders(FolderName: Folder): not nullable List<Folder>

 

static List<Folder>! GetSubfolders(Folder FolderName)

 

static func GetSubfolders(_ FolderName: Folder) -> List<Folder>

 

static List<Folder>! GetSubfolders(Folder FolderName)

Parameters:

  • FolderName:

GetSubfolders  mapped

 

method GetSubfolders: not nullable List<Folder>

 

List<Folder>! GetSubfolders()

 

func GetSubfolders() -> List<Folder>

 

List<Folder>! GetSubfolders()

Name

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

Rename  mapped

 

method Rename(NewName: String): Folder

 

Folder Rename(String NewName)

 

func Rename(_ NewName: String) -> Folder

 

Folder Rename(String NewName)

Parameters:

  • NewName:

Separator

Gets a char that is used as directory separator.

 

class property Separator: Char read;

 

class Char Separator { get; }

 

static var Separator: Char { get{} }

 

class Char Separator { __get; }

UserHomeFolder

 

class method UserHomeFolder: Folder

 

static Folder UserHomeFolder()

 

static func UserHomeFolder() -> Folder

 

static Folder UserHomeFolder()

 

Extension

 

property Extension: String read;

 

String Extension { get; }

 

var Extension: String { get{} }

 

String Extension { __get; }

FullPath

 

property FullPath: String read;

 

String FullPath { get; }

 

var FullPath: String { get{} }

 

String FullPath { __get; }

Name

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

Separator

Gets a char that is used as directory separator.

 

class property Separator: Char read;

 

class Char Separator { get; }

 

static var Separator: Char { get{} }

 

class Char Separator { __get; }

 

Create (Folder, Boolean): Folder

 

class method Create(FolderName: Folder; FailIfExists: Boolean): Folder

 

static Folder Create(Folder FolderName, Boolean FailIfExists)

 

static func Create(_ FolderName: Folder, _ FailIfExists: Boolean) -> Folder

 

static Folder Create(Folder FolderName, Boolean FailIfExists)

Parameters:

  • FolderName:
  • FailIfExists:

Delete (Folder)

 

class method Delete(FolderName: Folder)

 

static void Delete(Folder FolderName)

 

static func Delete(_ FolderName: Folder)

 

static void Delete(Folder FolderName)

Parameters:

  • FolderName:

Exists (Folder): Boolean

 

class method Exists(FolderName: Folder): Boolean

 

static Boolean Exists(Folder FolderName)

 

static func Exists(_ FolderName: Folder) -> Boolean

 

static Boolean Exists(Folder FolderName)

Parameters:

  • FolderName:

GetFiles (Folder, Boolean): not nullable List<File>

 

class method GetFiles(FolderName: Folder; aRecursive: Boolean): not nullable List<File>

 

static List<File>! GetFiles(Folder FolderName, Boolean aRecursive)

 

static func GetFiles(_ FolderName: Folder, _ aRecursive: Boolean) -> List<File>

 

static List<File>! GetFiles(Folder FolderName, Boolean aRecursive)

Parameters:

  • FolderName:
  • aRecursive:

GetSubfolders (Folder): not nullable List<Folder>

 

class method GetSubfolders(FolderName: Folder): not nullable List<Folder>

 

static List<Folder>! GetSubfolders(Folder FolderName)

 

static func GetSubfolders(_ FolderName: Folder) -> List<Folder>

 

static List<Folder>! GetSubfolders(Folder FolderName)

Parameters:

  • FolderName:

UserHomeFolder

 

class method UserHomeFolder: Folder

 

static Folder UserHomeFolder()

 

static func UserHomeFolder() -> Folder

 

static Folder UserHomeFolder()

 

constructor

 

constructor(aPath: not nullable String)

 

Folder(String! aPath)

 

init(_ aPath: String)

 

Folder(String! aPath)

Parameters:

  • aPath:

Create (Boolean)  mapped

 

method Create(FailIfExists: Boolean)

 

void Create(Boolean FailIfExists)

 

func Create(_ FailIfExists: Boolean)

 

void Create(Boolean FailIfExists)

Parameters:

  • FailIfExists:

CreateFile  mapped

 

method CreateFile(FileName: String; FailIfExists: Boolean): File

 

File CreateFile(String FileName, Boolean FailIfExists)

 

func CreateFile(_ FileName: String, _ FailIfExists: Boolean) -> File

 

File CreateFile(String FileName, Boolean FailIfExists)

Parameters:

  • FileName:
  • FailIfExists:

CreateSubfolder  mapped

 

method CreateSubfolder(SubfolderName: String; FailIfExists: Boolean): Folder

 

Folder CreateSubfolder(String SubfolderName, Boolean FailIfExists)

 

func CreateSubfolder(_ SubfolderName: String, _ FailIfExists: Boolean) -> Folder

 

Folder CreateSubfolder(String SubfolderName, Boolean FailIfExists)

Parameters:

  • SubfolderName:
  • FailIfExists:

Delete  mapped

 

method Delete

 

void Delete()

 

func Delete()

 

void Delete()

Exists  mapped

 

method Exists: Boolean

 

Boolean Exists()

 

func Exists() -> Boolean

 

Boolean Exists()

GetFile  mapped

 

method GetFile(FileName: String): File

 

File GetFile(String FileName)

 

func GetFile(_ FileName: String) -> File

 

File GetFile(String FileName)

Parameters:

  • FileName:

GetFiles  mapped

 

method GetFiles: not nullable List<File>

 

List<File>! GetFiles()

 

func GetFiles() -> List<File>

 

List<File>! GetFiles()

GetFiles (Boolean): not nullable List<File>  mapped

 

method GetFiles(aRecursive: Boolean): not nullable List<File>

 

List<File>! GetFiles(Boolean aRecursive)

 

func GetFiles(_ aRecursive: Boolean) -> List<File>

 

List<File>! GetFiles(Boolean aRecursive)

Parameters:

  • aRecursive:

GetSubfolders  mapped

 

method GetSubfolders: not nullable List<Folder>

 

List<Folder>! GetSubfolders()

 

func GetSubfolders() -> List<Folder>

 

List<Folder>! GetSubfolders()

Rename  mapped

 

method Rename(NewName: String): Folder

 

Folder Rename(String NewName)

 

func Rename(_ NewName: String) -> Folder

 

Folder Rename(String NewName)

Parameters:

  • NewName: