1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
11 #include "Directory.hpp"
16 using namespace workdir;
18 void filesystem::Directory::print (const int level) const
21 filesystem::Directory::const_child_iterator ii;
22 filesystem::Directory::const_child_iterator maxii = child_end ();
23 const filesystem::Directory* auxd;
24 const filesystem::File* auxf;
26 bool hasDirectories = false;
28 for (int space = 0; space < level; space ++)
31 cout << getName () << "/ (" << child_size () << "): " << endl;
34 * Recorre todas las dependencias y visualiza primero todos los ficheros
36 for (ii = child_begin (); ii != maxii; ii ++) {
37 auxf = filesystem::File::down_cast (filesystem::Directory::child (ii));
40 hasDirectories = true;
45 for (int space = 0; space < level + 1; space ++)
49 auxf->print (level + 1);
61 * Trata los directorios recursivamente
63 for (ii = child_begin (); hasDirectories == true && ii != maxii; ii ++) {
64 auxd = filesystem::Directory::down_cast (filesystem::Directory::child (ii));
67 auxd->print (level + 1);