⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 esvn_utils.h

📁 linux 下的 图形化的 SVN 相当于 VSS
💻 H
字号:
#if !defined(ESVN_UTILS_H)#define ESVN_UTILS_H#include <ctime>#include <qlistview.h> #include <qdir.h>#include <vector>namespace EsvnLVI{    enum Item {        ITEM_NAME = 0,        ITEM_FULL_PATH = 16,        ITEM_WORKING_DIRECTORY = 20,        ITEM_RELATIVE_PATH = 21,    };    QListViewItem* getFirstSelectedItem(QListView *view);}// Simple two-component path representation : base and nameclass C_Path{public:    C_Path();    virtual ~C_Path();public:    virtual QString Name() const = 0;    virtual QString Path() const = 0;    virtual bool isDir() const = 0;    virtual QString FullPath() const {        if (Path().isEmpty()) {            return "";        } else if (Name().isEmpty()) {            return Path();        } else {            return Path() + "/" + Name();        }    }public:    static QString Concat(const QString& prefix, const QString& suffix)    {        if (prefix.isEmpty()) {            return suffix;        } else if (suffix.isEmpty()) {            return prefix;        }        return prefix + "/" + suffix;    }};// Directory path implementationclass C_DirPath : public C_Path{public:    C_DirPath();    C_DirPath(const QDir& path) {        operator=(path);    }    ~C_DirPath();public:    virtual QString Name() const;    virtual QString Path() const;    virtual bool isDir() const;public:    void SetName(const QString& name);    void SetPath(const QString& name);    C_DirPath& operator=(const QDir& path);private:    QString name_;    QString pathname_;};// Standalone path objectclass C_PathCopy : public C_Path{public:    C_PathCopy();    C_PathCopy(const C_Path& from);    ~C_PathCopy();public:    C_PathCopy& operator=(const C_Path& from);public:    virtual QString Name() const;    virtual QString Path() const;    virtual bool isDir() const;private:    QString name_;    QString pathname_;    bool is_dir_;};// File path implementationclass C_RelativePath : public C_Path{public:    C_RelativePath(const C_Path& parent, const QString& name);    ~C_RelativePath();public:    virtual QString Name() const;    virtual QString Path() const;    virtual bool isDir() const;public:    void SetIsDir(bool is_dir);private://    const C_Path& parent_;    const C_PathCopy parent_;    QString name_;    bool is_dir_;};// Selection containerstypedef std::vector<C_PathCopy> PathSelection;class C_SinglePathSelection{public:    C_SinglePathSelection(const C_Path& selected)    {        selection_.push_back(selected);    }    operator const PathSelection& () const    {        return selection_;    }private:    PathSelection selection_;};#endif // ESVN_UTILS_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -