/*File Name: main.cpp
  Author: Betti Österholz ; Date: 20.08.2002
  Mat. Nr.: 706585


  Copyright (C) 2004  Betti Österholz

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2, June 1991, of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#include "CDoubleOut.h"

CDoubleOut::CDoubleOut():FileName("Protocol.txt")
   {}

CDoubleOut::CDoubleOut(char* fnam):FileName(fnam)
   {}

void CDoubleOut::Print(const string& out)
   //output the string out in a file and on the standart output
   //pre: string out
   {
   ofstream fout(FileName,ios::app);
   cout<<out;
   fout<<out;
   }

void CDoubleOut::Printi(const long& out)
   //output the long value out in a file and on the standart output
   //pre: long out
   {
   ofstream fout(FileName,ios::app);
   cout<<out;
   fout<<out;
   }

void CDoubleOut::Printi(const int& out)
   //output the int value out in a file and on the standart output
   //pre: int out
   {
   ofstream fout(FileName,ios::app);
   cout<<out;
   fout<<out;
   }

void CDoubleOut::Printd(const double& out)
   //output the double value out in a file and on the standart output
   //pre: int out
   {
   ofstream fout(FileName,ios::app);
   cout<<out;
   fout<<out;
   }

void CDoubleOut::Printb(const bool& out)
   //output the bool value out in a file and on the standart output
   //pre: bool out
   {
   ofstream fout(FileName,ios::app);
   if (out)
   {
      cout<<"yes";
      fout<<"yes";
   }else{
      cout<<"no";
      fout<<"no";
   }
   }

void CDoubleOut::operator=(const int& out)
   //output the int out in a file
   //pre: int out
   {
   ofstream fout(FileName,ios::app);
   fout<<out<<endl;
   }

void CDoubleOut::operator=(const string& out)
   //output the string out in a file
   //pre: int out
   {
   ofstream fout(FileName,ios::app);
   fout<<out<<endl;
   }

void CDoubleOut::operator=(const char& out)
   //output the char out in a file
   //pre: int out
   {
   ofstream fout(FileName,ios::app);
   fout<<out<<endl;
   }
