#include "Encryption.h"

//**************************************************
// Constructor opens the input and output file.    *
//**************************************************
Encryption::Encryption(const std::string& inFileName, const std::string& outFileName)
{
    inFile.open(inFileName);
    outFile.open(outFileName);
}

//**************************************************
//Destructor closes files.                         *
//**************************************************
Encryption::~Encryption()
{
    inFile.close();
    outFile.close();
}

//*****************************************************
//Encrypt function uses the virtual transform         *
//member function to transform individual characters. *
//***************************************************** 
void Encryption::encrypt()
{
    char ch;
    char transCh;

    while (inFile.get(ch)) {
        transCh = transform(ch);
        outFile.put(transCh);
    }
}