mergerfs/src/branch_tier.cpp

41 lines
772 B
C++
Raw Normal View History

2024-01-28 22:45:38 -06:00
#include "branch_tier.hpp"
#include "fmt/core.h"
2024-01-28 23:23:50 -06:00
namespace l
{
static
void
2024-01-28 23:31:07 -06:00
load_branch_literal(toml::table const &v_,
std::vector<Branch2> &branches_)
2024-01-28 23:23:50 -06:00
{
}
}
2024-01-28 22:45:38 -06:00
BranchTier::BranchTier()
{
}
BranchTier::BranchTier(toml::value const &v_)
{
auto const &branches = toml::find(v_,"branch").as_array();
for(auto const &branch : branches)
{
2024-01-28 23:29:04 -06:00
std::string type;
2024-01-28 22:45:38 -06:00
auto const &table = branch.as_table();
2024-01-28 23:03:45 -06:00
type = table.at("type").as_string();
2024-01-28 23:19:24 -06:00
if(type == "literal")
2024-01-28 23:29:59 -06:00
l::load_branch_literal(table,_branches);
2024-01-28 23:19:24 -06:00
else if(type == "glob")
2024-01-28 23:29:59 -06:00
l::load_branch_glob(table,_branches);
2024-01-28 23:19:24 -06:00
else if(type == "scan")
2024-01-28 23:29:59 -06:00
l::load_branch_scan(table,_branches);
2024-01-28 23:03:34 -06:00
fmt::print("{}\n",type);
2024-01-28 22:45:38 -06:00
}
}