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:
Antonio SJ Musumeci 2020-12-19 15:06:08 -05:00
parent 2e4c6c5fd1
commit 538467b86d
327 changed files with 6691 additions and 3036 deletions

View file

@ -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_)
{