Function gkfs::path::match_components(const string&, unsigned int&, const ::vector<string>&)

Function Documentation

unsigned int gkfs::path::match_components(const string &path, unsigned int &path_components, const ::vector<string> &components)

Match components in path

Returns the number of consecutive components at start of path that match the ones in components vector.

path_components will be set to the total number of components found in path

Example:

 unsigned int tot_comp;
 path_match_components("/matched/head/with/tail", &tot_comp, ["matched",
"head", "no"]) == 2; tot_comp == 4;