mergerfs/src/config_getattr_statx.hpp
Antonio SJ Musumeci b3b8e793f9 Change getattr and statx to bespoke policies
* Provides: slight improvement in performance as it no longer will
need to find and then act on the files.
* It doesn't make sense to support all original policy types. Most
people used 'newest' or 'ff' and 'combine' is a better default which
has same runtime as 'newest' but with better output.
2025-12-27 22:14:56 -06:00

41 lines
659 B
C++

#pragma once
#include "config.hpp"
#include "tofrom_string.hpp"
class ConfigGetAttrStatx : public ToFromString
{
private:
Func2::GetAttr &_getattr;
Func2::Statx &_statx;
public:
ConfigGetAttrStatx() = delete;
ConfigGetAttrStatx(Func2::GetAttr &getattr_,
Func2::Statx &statx_)
: _getattr(getattr_),
_statx(statx_)
{
}
std::string
to_string() const
{
return _getattr.to_string();
}
int
from_string(const std::string_view str_)
{
int rv;
rv = _getattr.from_string(str_);
if(rv < 0)
return rv;
rv = _statx.from_string(str_);
assert(rv == 0);
return rv;
}
};