Hydra 0.20
|
00001 00002 /* 00003 * Copyright (c) 2009 Aleksander B. Demko 00004 * This source code is distributed under the MIT license. 00005 * See the accompanying file LICENSE.MIT.txt for details. 00006 */ 00007 00008 #ifndef __INCLUDED_HYDRA_FILEOP_H__ 00009 #define __INCLUDED_HYDRA_FILEOP_H__ 00010 00011 #include <QString> 00012 00013 namespace hydra 00014 { 00015 // returns true on success 00016 bool linkFile(const QString &srcfile, const QString &destfile); 00017 // returns true on success 00018 bool moveFile(const QString &srcfile, const QString &destfile); 00019 // returns true on success 00020 bool delFile(const QString &srcfile); 00021 // returns true on success 00022 bool copyFile(const QString &srcfile, const QString &destfile); 00023 /** 00024 * A "smart" copy. If the file exists, this function will fail. 00025 * Otherwise, it will try to LINK the file. If that files, 00026 * it will do a copy operation 00027 * 00028 * @return true on success 00029 * @author Aleksander Demko 00030 */ 00031 bool smartCopy(const QString &srcfile, const QString &destfile); 00032 // returns true on success 00033 bool delDir(const QString &dirpath); 00034 } 00035 00036 #endif 00037