Example #1
0
UCS2String GetFileName(const Path& p)
{
    UCS2String::size_type pos = p.GetFile().find_last_of('.');

    if(pos != UCS2String::npos)
        return UCS2String(p.GetFile(), 0, pos);

    return p.GetFile();
}
Example #2
0
bool Path::operator==(const Path& p) const
{
	if(volume != p.GetVolume())
		return false;

	if(folders != p.GetAllFolders())
		return false;

	if(file != p.GetFile())
		return false;

	return true;
}
Example #3
0
Path::Path(const Path& p1, const Path& p2)
{
	// TODO: Handle case p2.HasVolume()==true

	vector<UCS2String> f1(p1.GetAllFolders());
	vector<UCS2String> f2(p2.GetAllFolders());

	volume = p1.GetVolume();

	for(vector<UCS2String>::iterator i(f1.begin()); i != f1.end(); i++)
		folders.push_back(*i);
	for(vector<UCS2String>::iterator i(f2.begin()); i != f2.end(); i++)
		folders.push_back(*i);

	file = p2.GetFile();
}