45 lines
1.4 KiB
C
Raw Normal View History

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
static bool Exists(const String& Path);
2022-05-21 19:58:09 +02:00
// Creates a new directory at the given path
static void CreateDirectory(const String& Path);
2022-05-21 19:58:09 +02:00
// Returns the current directory set
static String GetCurrentDirectory();
2022-05-21 19:58:09 +02:00
// Sets the current directory
static void SetCurrentDirectory(const String& Path);
2022-05-21 19:58:09 +02:00
// Moves the source path to the destination path
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
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
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
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
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
static List<String> GetDirectories(const String& Path);
2022-05-21 19:58:09 +02:00
// Returns an array of logical drives
static List<String> GetLogicalDrives();
2022-05-21 19:58:09 +02:00
};
}