2022-05-21 19:58:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Path.h"
|
|
|
|
#include "IOError.h"
|
|
|
|
#include "ListBase.h"
|
|
|
|
#include "StringBase.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// Remove Win32 macros
|
|
|
|
//
|
|
|
|
|
|
|
|
#undef CreateDirectory
|
|
|
|
#undef GetCurrentDirectory
|
|
|
|
#undef SetCurrentDirectory
|
|
|
|
|
|
|
|
namespace IO
|
|
|
|
{
|
|
|
|
class Directory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Checks whether or not the specified path exists
|
2022-05-21 21:51:35 +02:00
|
|
|
static bool Exists(const String& Path);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Creates a new directory at the given path
|
2022-05-21 21:51:35 +02:00
|
|
|
static void CreateDirectory(const String& Path);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns the current directory set
|
2022-05-21 21:51:35 +02:00
|
|
|
static String GetCurrentDirectory();
|
2022-05-21 19:58:09 +02:00
|
|
|
// Sets the current directory
|
2022-05-21 21:51:35 +02:00
|
|
|
static void SetCurrentDirectory(const String& Path);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Moves the source path to the destination path
|
2022-05-21 21:51:35 +02:00
|
|
|
static void Move(const String& SourcePath, const String& DestinationPath);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Copies the source path to the destination path
|
2022-05-21 21:51:35 +02:00
|
|
|
static void Copy(const String& SourcePath, const String& DestinationPath, bool OverWrite = false);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Deletes a directory, optionally recursive if it's not empty
|
2022-05-21 21:51:35 +02:00
|
|
|
static bool Delete(const String& Path, bool Recursive = true);
|
2022-05-21 19:58:09 +02:00
|
|
|
|
|
|
|
// Returns an array of files in the current path
|
2022-05-21 21:51:35 +02:00
|
|
|
static List<String> GetFiles(const String& Path);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns an array of files in the current path matching the search pattern
|
2022-05-21 21:51:35 +02:00
|
|
|
static List<String> GetFiles(const String& Path, const String& SearchPattern);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns an array of folders in the current path
|
2022-05-21 21:51:35 +02:00
|
|
|
static List<String> GetDirectories(const String& Path);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Returns an array of logical drives
|
2022-05-21 21:51:35 +02:00
|
|
|
static List<String> GetLogicalDrives();
|
2022-05-21 19:58:09 +02:00
|
|
|
};
|
|
|
|
}
|