mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
31 lines
519 B
C++
31 lines
519 B
C++
|
|
#include "func_rmdir_factory.hpp"
|
||
|
|
|
||
|
|
#include "func_rmdir_all.hpp"
|
||
|
|
|
||
|
|
#include "policies.hpp"
|
||
|
|
|
||
|
|
|
||
|
|
bool
|
||
|
|
Func2::RmdirFactory::valid(const std::string str_)
|
||
|
|
{
|
||
|
|
if(str_ == "all")
|
||
|
|
return true;
|
||
|
|
|
||
|
|
if(Policies::Action::find(str_))
|
||
|
|
return true;
|
||
|
|
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
std::shared_ptr<Func2::RmdirBase>
|
||
|
|
Func2::RmdirFactory::make(const std::string_view str_)
|
||
|
|
{
|
||
|
|
if(str_ == "all")
|
||
|
|
return std::make_shared<Func2::RmdirAll>();
|
||
|
|
|
||
|
|
if(Policies::Action::find(str_))
|
||
|
|
return std::make_shared<Func2::RmdirAll>();
|
||
|
|
|
||
|
|
return {};
|
||
|
|
}
|