6[BadInteropApi(
"Directory",
true)]
19 [BadMethod(description:
"Creates all directories and subdirectories in the specified path.")]
20 private void
CreateDirectory([BadParameter(description:
"The directory to create.")] string path)
25 [BadMethod(description:
"Deletes the specified directory and, if indicated, any subdirectories in the directory.")]
26 [return: BadReturn(
"True if the directory exists; otherwise, false.")]
27 private bool
Exists([BadParameter(description:
"The Path to check")] string path)
32 [BadMethod(description:
"Deletes the specified directory and, if indicated, any subdirectories in the directory.")]
34 [BadParameter(description:
"The Path to delete")]
36 [BadParameter(description:
"If true, the directory will be deleted recursively")]
42 [BadMethod(description:
"Returns the Current Working Directory.")]
43 [return: BadReturn(
"The Current Working Directory")]
49 [BadMethod(description:
"Sets the Current Working Directory.")]
50 private void
SetCurrentDirectory([BadParameter(description:
"The Path to set as the Current Working Directory.")] string path)
55 [BadMethod(description:
"Returns the startup directory")]
56 [return: BadReturn(
"The startup directory")]
62 [BadMethod(description:
"Returns the directories in the specified directory.")]
63 [return: BadReturn(
"An array of directories in the specified directory.")]
65 [BadParameter(description:
"The Path to get the directories from.")]
67 [BadParameter(description:
"If true, the search will return all subdirectories recursively")]
68 bool recursive = false)
73 [BadMethod(description:
"Returns the files in the specified directory.")]
74 [return: BadReturn(
"An array of files in the specified directory.")]
76 [BadParameter(description:
"The Path to get the files from.")]
78 [BadParameter(description:
"The search pattern.")]
79 string searchPattern =
"",
80 [BadParameter(description:
"If true, the search will return all subdirectories recursively")]
81 bool recursive = false)
86 [BadMethod(description:
"Moves a specified file to a new location, providing the option to specify a new file name.")]
88 [BadParameter(description:
"The Path of the file to move")]
90 [BadParameter(description:
"The Destination Path")]
92 [BadParameter(description:
"If true, allows an existing file to be overwritten; otherwise, false.")]
93 bool overwrite = false)
98 [BadMethod(description:
"Copies a specified file to a new location, providing the option to specify a new file name.")]
100 [BadParameter(description:
"The Path of the file to copy")]
102 [BadParameter(description:
"The Destination Path")]
104 [BadParameter(description:
"If true, allows an existing file to be overwritten; otherwise, false.")]
105 bool overwrite = false)
Public interface for the filesystem abstraction of the BadScript Engine.
static IFileSystem Instance
File System implementation.
bool Exists([BadParameter(description:"The Path to check")] string path)
void Delete([BadParameter(description:"The Path to delete")] string path, [BadParameter(description:"If true, the directory will be deleted recursively")] bool recursive)
void SetCurrentDirectory([BadParameter(description:"The Path to set as the Current Working Directory.")] string path)
BadArray GetFiles([BadParameter(description:"The Path to get the files from.")] string path, [BadParameter(description:"The search pattern.")] string searchPattern="", [BadParameter(description:"If true, the search will return all subdirectories recursively")] bool recursive=false)
string GetCurrentDirectory()
BadDirectoryApi(IFileSystem fileSystem)
readonly IFileSystem m_FileSystem
The FileSystem Instance.
void Move([BadParameter(description:"The Path of the file to move")] string source, [BadParameter(description:"The Destination Path")] string destination, [BadParameter(description:"If true, allows an existing file to be overwritten; otherwise, false.")] bool overwrite=false)
void Copy([BadParameter(description:"The Path of the file to copy")] string source, [BadParameter(description:"The Destination Path")] string destination, [BadParameter(description:"If true, allows an existing file to be overwritten; otherwise, false.")] bool overwrite=false)
string GetStartupDirectory()
void CreateDirectory([BadParameter(description:"The directory to create.")] string path)
BadArray GetDirectories([BadParameter(description:"The Path to get the directories from.")] string path, [BadParameter(description:"If true, the search will return all subdirectories recursively")] bool recursive=false)
Implements a Dynamic List/Array for the BadScript Language.
The Base Class for all BadScript Objects.
Defines the interface for a file system.
void SetCurrentDirectory(string path)
Sets the current Directory.
void DeleteDirectory(string path, bool recursive)
Deletes a directory.
bool IsDirectory(string path)
Returns true if the given path is a directory.
string GetCurrentDirectory()
Returns the Current Directory.
void CreateDirectory(string path, bool recursive=false)
Creates a new directory.
void Copy(string src, string dst, bool overwrite=true)
Copies a file or directory to a new location.
IEnumerable< string > GetDirectories(string path, bool recursive)
Returns all directories in the given directory.
IEnumerable< string > GetFiles(string path, string extension, bool recursive)
Returns all files in the given directory that match the specified extension.
string GetStartupDirectory()
The Startup Directory of the Application.
bool Exists(string path)
Returns true if the given path is a file or directory.
void Move(string src, string dst, bool overwrite=true)
Moves a file or directory to a new location.
Contains IO Implementation for the BadScript2 Runtime.
Contains IO Extensions and APIs for the BadScript2 Runtime.
Contains the Runtime Objects.