Ejemplo n.º 1
0
		bool equalStacks(Paths<DiGraph>::VertexStack lhs, Paths<DiGraph>::VertexStack rhs)
		{
			if (lhs.size() != rhs.size())
				return false;
			while (!lhs.empty())
			{
				if (lhs.top() != rhs.top())
					return false;
				lhs.pop();
				rhs.pop();
			}
			return true;
		}
Ejemplo n.º 2
0
int
main( int argc, char** argv)
{
  fs::path full_path( fs::initial_path<fs::path>() );

  if ( argc > 1 )
    full_path = fs::system_complete( fs::path( argv[1], fs::native ) );
  else
    PrintUsage();

  // specification of hi, low date of studies
  if( argc > 2)
  {
    string s(argv[2]);
    if( s.compare( "--info") == 0 )
    {
      entryCont.infoOnly = true;
    }
    else
    {
      if( argc > 3)
      {
        entryCont.dateFrom = argv[2];
        entryCont.dateTo = argv[3];
      }
      else
        PrintUsage();
    }
  }

  // recursively (through queue) go through all files in subtree
  // of specified directory specified

  try {
    if ( fs::is_directory( full_path ) )
    {
      paths.push( full_path);
    }
    else // must be a file
    {
      entryCont.SolveFile( full_path.string(), "buddy" );
    }

    fs::path currPath;
    while( ! paths.empty() )
    {
      currPath = paths.front();
      SolveDir( currPath);
      paths.pop(); // remove this dir from queue
    }
    
  } catch( std::exception &ex) {
    LOG( ex.what());
  }

  // flush info
  {
    ofstream o("output.txt");
    entryCont.FlushMaps( o);
    o.close();
  }
  
  return 0;
}