Exemple #1
0
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;
}
Exemple #2
0
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);
}
Exemple #3
0
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();
}
Exemple #4
0
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;
}