NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
recycler.cpp
Go to the documentation of this file.
1#include "recycler.hpp"
2#include <tchar.h>
3
5{
6 memset((SHFILEOPSTRUCT*)this, 0, sizeof(SHFILEOPSTRUCT));
7 fFlags |= FOF_SILENT;
8 fFlags |= FOF_NOERRORUI;
9 fFlags |= FOF_NOCONFIRMATION;
10}
11
12int Recycler::recycle(const char* pszPath, bool bDelete)
13{
14 TCHAR buf[_MAX_PATH + 1];
15 strcpy(buf, pszPath);
16 buf[strlen(buf) + 1] = 0;
17
18 wFunc = FO_DELETE;
19 pFrom = buf;
20 pTo = nullptr;
21
22 if (bDelete)
23 {
24 fFlags &= ~FOF_ALLOWUNDO;
25 }
26 else
27 {
28 fFlags |= FOF_ALLOWUNDO;
29 }
30 return SHFileOperation(this);
31}
32
int recycle(const char *pszPath, bool bDelete=false)
Definition: recycler.cpp:12
Recycler()
Definition: recycler.cpp:4