aboutsummaryrefslogtreecommitdiff
path: root/libs/plugin_python/tests/mocks/DummyFileTree.h
blob: cf81691b9b7d6a9a3dfb426cbfd352f11fe677a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef DUMMY_TREE_H
#define DUMMY_TREE_H

#include <uibase/ifiletree.h>

// filetree implementation for testing purpose
//
class DummyFileTree : public MOBase::IFileTree {
public:
    DummyFileTree(std::shared_ptr<const IFileTree> parent, QString name)
        : FileTreeEntry(parent, name), IFileTree()
    {
    }

protected:
    std::shared_ptr<IFileTree> makeDirectory(std::shared_ptr<const IFileTree> parent,
                                             QString name) const override
    {
        return std::make_shared<DummyFileTree>(parent, name);
    }

    bool doPopulate(std::shared_ptr<const IFileTree>,
                    std::vector<std::shared_ptr<FileTreeEntry>>&) const override
    {
        return true;
    }

    std::shared_ptr<IFileTree> doClone() const override
    {
        return std::make_shared<DummyFileTree>(nullptr, name());
    }
};

#endif