well, restructured things a bit, but mostly started trying to sort LocationConfigs, it is sort of going well, good ideas, implementations is still a bit lacking...

This commit is contained in:
Me
2022-08-04 01:09:40 +02:00
parent b0c524a8bd
commit 3d46505411
13 changed files with 363 additions and 122 deletions

View File

@@ -0,0 +1,27 @@
// prolly get rid of this file...
#include "LocationConfig.hpp"
#include <string>
#include <algorithm>
// Ok so maybe it can't be a member functions?
bool compareLocationConfigs(const LocationConfig &a, const LocationConfig &b)
{
int len_a;
int len_b;
size_t tmp = 0;
// consider adding 1 to path that ends in a file not folder.
while ((tmp = a.path.find_first_of("/", tmp)) != std::string::npos)
++len_a;
tmp = 0;
while ((tmp = b.path.find_first_of("/", tmp)) != std::string::npos)
++len_b;
return (len_a < len_b); // right comparison ? not <= ?
}