mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Add "per-process" file caching feature
Allows chosing page caching based on process name.
This commit is contained in:
parent
b51a5970b2
commit
9effeb6869
15 changed files with 363 additions and 55 deletions
32
src/str.cpp
32
src/str.cpp
|
|
@ -40,6 +40,18 @@ namespace str
|
|||
result_->push_back(part);
|
||||
}
|
||||
|
||||
void
|
||||
split(const char *str_,
|
||||
const char delimiter_,
|
||||
set<string> *result_)
|
||||
{
|
||||
string part;
|
||||
istringstream ss(str_);
|
||||
|
||||
while(std::getline(ss,part,delimiter_))
|
||||
result_->insert(part);
|
||||
}
|
||||
|
||||
void
|
||||
split(const string &str_,
|
||||
const char delimiter_,
|
||||
|
|
@ -48,6 +60,14 @@ namespace str
|
|||
return str::split(str_.c_str(),delimiter_,result_);
|
||||
}
|
||||
|
||||
void
|
||||
split(const string &str_,
|
||||
const char delimiter_,
|
||||
set<string> *result_)
|
||||
{
|
||||
return str::split(str_.c_str(),delimiter_,result_);
|
||||
}
|
||||
|
||||
void
|
||||
rsplit1(const string &str_,
|
||||
const char delimiter_,
|
||||
|
|
@ -112,16 +132,10 @@ namespace str
|
|||
const char sep_)
|
||||
{
|
||||
string rv;
|
||||
set<string>::iterator i;
|
||||
|
||||
if(set_.empty())
|
||||
return string();
|
||||
|
||||
i = set_.begin();
|
||||
rv += *i;
|
||||
++i;
|
||||
for(; i != set_.end(); ++i)
|
||||
rv += sep_ + *i;
|
||||
for(auto const &s : set_)
|
||||
rv += s + sep_;
|
||||
rv.pop_back();
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue