Exemplo n.º 1
0
void Directory::eraseContent(const std::string& name)
{
  assert(!name.empty());
  Iterator::Ptr it = enumerate(name);
  while(it->moveNext())
    {
      if (it->name() == "." || it->name() == "..")
	continue;
      const std::string& path = it->fullPath();
      if (File::isDir(path))
	{
	  eraseContent(path);
	  remove(path);
	  continue;
	}
      File::unlink(path);
    }
}