Arbiter  0.0.0
test.hpp
1 #pragma once
2 
3 #include <numeric>
4 
5 #ifndef ARBITER_IS_AMALGAMATION
6 #include <arbiter/drivers/fs.hpp>
7 #endif
8 
9 #ifdef ARBITER_CUSTOM_NAMESPACE
10 namespace ARBITER_CUSTOM_NAMESPACE
11 {
12 #endif
13 
14 namespace arbiter
15 {
16 
17 class Arbiter;
18 
19 namespace drivers
20 {
21 
25 class Test : public Fs
26 {
27 public:
28  static std::unique_ptr<Test> create(const Json::Value& json)
29  {
30  return std::unique_ptr<Test>(new Test());
31  }
32 
33  virtual std::string type() const override { return "test"; }
34  virtual bool isRemote() const override { return true; }
35 
36 private:
37  virtual std::vector<std::string> glob(
38  std::string path,
39  bool verbose) const override
40  {
41  auto results(Fs::glob(path, verbose));
42  for (auto& p : results) p = type() + "://" + p;
43  return results;
44  }
45 };
46 
47 } // namespace drivers
48 
49 } // namespace arbiter
50 
51 #ifdef ARBITER_CUSTOM_NAMESPACE
52 }
53 #endif
54 
A filesystem driver that acts as if it were remote for testing purposes.
Definition: test.hpp:25
virtual bool isRemote() const override
Definition: test.hpp:34
Definition: arbiter.cpp:16
Local filesystem driver.
Definition: fs.hpp:102
virtual std::string type() const override
Definition: test.hpp:33