// prolly get rid of this file... #include "LocationConfig.hpp" #include #include // 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 <= ? }