File System Functions

// File system functions.
class RVAPI FileSys
{
public:
    // Check if file exists at [path].
    static bool IsFile(wcstr path);

    // Check if directory exists at [path].
    static bool IsDir(wcstr path);

    // Check if directory is empty at [path].
    static bool IsDirEmpty(wcstr path);

    // Get file date/time at [path].
    static DateTime GetFileDate(wcstr path);

    // Get directory date/time at [path].
    static DateTime GetDirDate(wcstr path);

    // Get file size at [path].
    static uint GetFileSize(wcstr path);

    // Get directory size at [path].
    static uint GetDirSize(wcstr path);

    // Get temp directory at [path].
    static void GetTempDir(String &path);

    // Get app directory at [path].
    static void GetAppDataDir(String &path);

    // Get documents directory at [path].
    static void GetDocsDir(String &path);

    // Get desktop directory at [path].
    static void GetDesktopDir(String &path);

    // Get absolute path of [path].
    static void GetAbsPath(String &abs, wcstr rel);

    // Set current directory to [path].
    static void GetCurDir(String &path);

    // Get file list. [list] must be an array of RVString items.
    // Select files using wildcards in [filter].
    static void GetFiles(wcstr path, Array<String> &files, wcstr filter);

    // Get directories list. [list] must be an array of RVString items.
    // Select files using wildcards in [filter].
    static void GetDirs(wcstr path, Array<String> &dirs, wcstr filter);

    // Copy file at [from] to location [to]. If [noError] is false,
    // a Rayve API error will occur if unable to perform copy.
    static void CopyFile(wcstr from, wcstr to, bool noError);

    // Delete file at [path]. If [noError] is false, a Rayve API error 
    // will occur if unable to perform deletion.
    static void DeleteFile(wcstr path, bool noError);

    // Rename file at [oldPath] to location [newPath]. 
    // A Rayve API error will occur if unable to perform rename.
    static void RenameFile(wcstr from, wcstr to);

    // Rename directory at [oldPath] to location [newPath]. 
    // A Rayve API error will occur if unable to perform rename.
    static void RenameDir(wcstr from, wcstr to);

    // Rename directory at [oldPath] to location [newPath]. 
    // A Rayve API error will occur if unable to perform move.
    static void MoveDir(wcstr from, wcstr to);

    // Create directory at [path].
    static void CreateDir(wcstr path);

    // Delete directory at [path].
    static void DeleteDir(wcstr path);

    // Select directory using Windows OS dialog at [path].
    static void SelectDir(const String &path);

    // Set current directory to app's home directory.
    static void SetCurDirToHomeDir();

    // Set current directory to [path].
    static void SetCurDir(wcstr path);
};