summaryrefslogtreecommitdiff
path: root/library/fileHandling.h
blob: a4f43391fcd75a66de344a1e3dbdd49669b6662b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef RECYCLER_H_INCLUDED
#define RECYCLER_H_INCLUDED

#include "globalFunctions.h"
#include <wx/dir.h>


class FileError //Exception class used to notify file/directory copy/delete errors
{
public:
    FileError(const wxString& txt) : errorMessage(txt) {}

    wxString show() const
    {
        return errorMessage;
    }

private:
    wxString errorMessage;
};


namespace FreeFileSync
{
    void getAllFilesAndDirs(const wxString& sourceDir, wxArrayString& files, wxArrayString& directories) throw(FileError);

    //recycler
    bool recycleBinExists(); //test existence of Recycle Bin API on current system

    //file handling
    void removeDirectory(const wxString& directory, const bool useRecycleBin);
    void removeFile(const wxString& filename, const bool useRecycleBin);
    void createDirectory(const wxString& directory, int level = 0); //level is used internally only
}


#endif // RECYCLER_H_INCLUDED
bgstack15