directory get_parent_directory (
        const file& f
    )
    {
        if (f.full_name().size() == 0)
            return directory();

        std::string::size_type pos = f.full_name().find_last_of("\\/");
        
        if (pos == std::string::npos)
            return directory();

        return directory(f.full_name().substr(0,pos));
    }
Example #2
0
void complain(file const& f, std::string const& complaint)
{
    std::cout << "File '" << f.full_name() << "' " << complaint << std::endl;
}