2010-08-10 18:12:50 +02:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2010, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
#ifndef headerfile_winix_functions_mv
|
|
|
|
#define headerfile_winix_functions_mv
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
#include "functionbase.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-05 22:24:11 +01:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
namespace Fun
|
|
|
|
{
|
|
|
|
|
|
|
|
|
2011-01-05 22:24:11 +01:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
class Mv : public FunctionBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Mv();
|
2011-01-05 22:24:11 +01:00
|
|
|
bool HasAccess();
|
2010-08-10 18:12:50 +02:00
|
|
|
void MakePost();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2011-01-05 22:24:11 +01:00
|
|
|
// destination dir
|
|
|
|
std::vector<Item*> dir_tab;
|
|
|
|
|
|
|
|
// destination file (if exists)
|
|
|
|
std::wstring file;
|
|
|
|
|
|
|
|
// for copying static files
|
|
|
|
std::wstring new_path, new_path_thumb;
|
|
|
|
std::wstring old_path, old_path_thumb;
|
|
|
|
|
|
|
|
// for static files
|
|
|
|
std::vector<Item> static_item_tab;
|
|
|
|
DbItemQuery static_iq;
|
|
|
|
|
|
|
|
// for moving content of a directory
|
|
|
|
DbItemQuery content_dir_iq;
|
|
|
|
std::vector<Item> item_tab;
|
|
|
|
|
|
|
|
// for logging
|
|
|
|
std::wstring old_url;
|
|
|
|
|
|
|
|
bool CheckAccessFromToDir();
|
|
|
|
bool CheckAccessFrom();
|
|
|
|
bool CheckAccessTo();
|
|
|
|
bool ParseDir();
|
|
|
|
bool MoveStaticFile(const std::wstring & from, const std::wstring & to);
|
2010-12-10 22:07:01 +01:00
|
|
|
void MoveStaticFile(Item & item);
|
2011-01-05 22:24:11 +01:00
|
|
|
void MoveFileOrSymlink(Item & item);
|
|
|
|
void MoveDirContent(const Item & dir);
|
|
|
|
void Prepare();
|
|
|
|
void Clear();
|
|
|
|
void MoveStaticFilesTree(const Item & dir);
|
|
|
|
void MoveDir(Item & dir);
|
|
|
|
bool IsTheSameFile(const Item & item);
|
|
|
|
void PostMoveFile();
|
|
|
|
void PostMoveDirContent();
|
|
|
|
void PostMoveDir();
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|