// CS2604 : Data Structures
// Hussein Suleman
// 22 July 1999
// Project 3

// Sample program to demonstrate how to use the DirectoryReader class

#include <iostream.h>
#include <string.h>

#include "dir.h"

// ---------------------------------------------------------------------

void OutputDir ( char *dir, char level )
{
   char s[2048];
   int state;

   DirectoryReader A (dir);
   while ((state = A.GetName (s, sizeof (s))))
   {
      if ((strcmp (s, ".") != 0) && (strcmp (s, "..") != 0))
      {
         for ( int i=0; i<=level; i++ )
            cout << "---";
         cout << s << "\n";
         if (state == 2)
         OutputDir (s, level+1);
      }
   }
}  

int main ()
{
   OutputDir ("..", 0);   
   return 0;
}