Tianchi  v0.0.2 build 20130701
C++ library for Qt with VC & mingW
tcdir.h
浏览该文件的文档.
1 // **************************************************************************
2 // Tianchi share library for Qt (C++)
3 // 天池共享源码库
4 // 版权所有 (C) 天池共享源码库开发组
5 // 授权协议:请阅读天池共享源码库附带的授权协议
6 // **************************************************************************
7 // 文档说明:可以复制目录树的类,也可以查找文件夹内所有的文件
8 // ==========================================================================
9 // 开发日志:
10 // 日期 人员 说明
11 // --------------------------------------------------------------------------
12 // 2013.04.21 cnhemiya@gmail.com 建立
13 //
14 // ==========================================================================
16 // ==========================================================================
17 #ifndef TIANCHI_TCDIR_H
18 #define TIANCHI_TCDIR_H
19 
20 #include <tianchi/tcglobal.h>
21 
22 #include <QObject>
23 #include <QStringList>
24 
27 class TIANCHI_API TcDir : public QObject
28 {
29  Q_OBJECT
30 public:
31  explicit TcDir(QObject *parent = 0);
32 
37  QStringList findFiles(const QString &path,
38  const QStringList &nameFilters = QStringList());
39 
46  int copyDirs(const QString &fromPath, const QString &toPath,
47  const QStringList &nameFilters = QStringList(),
48  bool overWrite = true);
49 
55  int copyFiles(const QStringList &files, const QString &toPath,
56  bool overWrite = true);
57 
59  void resetCopyFileCount();
60 
61 Q_SIGNALS:
65  void currentFile(int count, const QString &name);
66 
67 private:
68  int m_copyFileCount;
69 
70  void doDirTree(const QString &fromPath, const QString &toPath,
71  const QStringList &nameFilters, bool overWrite,
72  QStringList &findFiles, bool isFind);
73  QString formatPath(const QString &path);
74 };
75 
76 #endif // TIANCHI_TCDIR_H