std::string &zippath_parent_basename(std::string &dst, const char *path) { int beginpos, endpos; parse_parent_path(path, &beginpos, &endpos); dst.copy((char*)(path + beginpos + 1), endpos - beginpos); return dst; }
astring &zippath_parent_basename(astring &dst, const char *path) { int beginpos, endpos; parse_parent_path(path, &beginpos, &endpos); return dst.cpy(path + beginpos + 1, endpos - beginpos); }
astring &zippath_parent(astring &dst, const char *path) { int pos; parse_parent_path(path, &pos, NULL); /* return the result */ return (pos >= 0) ? dst.cpy(path, pos + 1) : dst.reset(); }
std::string &zippath_parent(std::string &dst, const char *path) { int pos; parse_parent_path(path, &pos, NULL); /* return the result */ if (pos >= 0) { dst.assign(path, pos + 1); } else { dst.clear(); } return dst; }