71 lines
1.3 KiB
C++
Executable File
71 lines
1.3 KiB
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2010, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef headerfile_winix_functions_rm
|
|
#define headerfile_winix_functions_rm
|
|
|
|
#include "functionbase.h"
|
|
|
|
|
|
|
|
namespace Fun
|
|
{
|
|
|
|
|
|
class Rm : public FunctionBase
|
|
{
|
|
public:
|
|
|
|
Rm();
|
|
bool HasAccess();
|
|
void MakePost();
|
|
|
|
void RemoveDir(const Item & dir);
|
|
void RemoveDirContent(const Item & dir);
|
|
void RemoveFileOrSymlink(Item & item);
|
|
|
|
// removing either a directory or a symlink or a file
|
|
void RemoveItemById(long item_id);
|
|
|
|
private:
|
|
|
|
// for deleting content in a directory (files and symlinks)
|
|
DbItemQuery content_dir_iq;
|
|
std::vector<Item> content_item_tab;
|
|
std::wstring path;
|
|
|
|
// for deleting content in a directory (files, symlinks and directories)
|
|
DbItemQuery content_dir_iq2;
|
|
std::vector<Item> content_item_tab2;
|
|
|
|
// for logging
|
|
std::wstring old_url;
|
|
|
|
// for removing an item by id
|
|
DbItemQuery rm_by_id_iq;
|
|
Item rm_by_id_item;
|
|
|
|
bool HasAccess(const Item & item);
|
|
void Prepare();
|
|
void Clear();
|
|
bool RemoveStaticFile(const std::wstring & path);
|
|
void RemoveStaticFile(Item & item);
|
|
void RemoveDirTree(long dir_id);
|
|
void RemoveDirContent();
|
|
void RemoveDir();
|
|
void RemoveFile();
|
|
void CreateJSON(bool status);
|
|
|
|
};
|
|
|
|
|
|
} // namespace
|
|
|
|
#endif
|