/* Query.cpp
 *
 */
 
#include "Query.h"

// --- Open an ifstream interactively ---------------------

void interactiveOpen(ifstream & theIFStream)
{
   cout << "Enter the name of the input file: ";
   string inputFileName;
   getline(cin, inputFileName);

   cin.get();


   theIFStream.open(inputFileName.data());

   if (!theIFStream.is_open())
   {
      cerr << "\n***InteractiveOpen(): unable to open "
           << inputFileName << endl;
      exit(1);
   }
}

// --- Open an ofstream interactively ---------------------

void interactiveOpen(ofstream & theOFStream)
{
   cout << "Enter the name of the output file: ";
   string outputFileName;
   getline(cin, outputFileName);

   cin.get();

   theOFStream.open(outputFileName.data());

   if (!theOFStream.is_open())
   {
      cerr << "\n***InteractiveOpen(): unable to open "
           << outputFileName << endl;
      exit(1);
   }
}


