mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-30 20:06:52 -05:00
config: rework global config, remove rwlock, make branches RCU like
Also added unit tests. Should have done separately but found a number of bugs.
This commit is contained in:
parent
2e4c6c5fd1
commit
538467b86d
327 changed files with 6691 additions and 3036 deletions
25
src/str.cpp
25
src/str.cpp
|
|
@ -14,15 +14,17 @@
|
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#include <fnmatch.h>
|
||||
|
||||
using std::istringstream;
|
||||
using std::set;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
using std::istringstream;
|
||||
|
||||
namespace str
|
||||
{
|
||||
|
|
@ -105,6 +107,25 @@ namespace str
|
|||
return str::join(vec_,0,sep_);
|
||||
}
|
||||
|
||||
string
|
||||
join(const set<string> &set_,
|
||||
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;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
size_t
|
||||
longest_common_prefix_index(const vector<string> &vec_)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue