/*
 * Jakelib2 - General purpose C++ library
 * Copyright (C) 2001 Florian Wolff  (florian@donuz.de)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * $Id: FileWriter.h,v 1.5 2002/08/18 14:39:27 florian Exp $
 */

#ifndef INCLUDE_JAKELIB2_IO_FILEWRITER_H
# define INCLUDE_JAKELIB2_IO_FILEWRITER_H
# include "OutputStreamWriter.h"
# include "File.h"

namespace jakelib {
  namespace io {

    /**
     * @brief  This is a convenience class for writing to files.
     *
     * It creates an \c FileOutputStream and initializes an 
     * \c OutputStreamWriter to write to it.
     *
     * @class FileWriter
     * @version $Id: FileWriter.h,v 1.5 2002/08/18 14:39:27 florian Exp $
     * @author Florian 'Overflo' Wolff (florian@donuz.de)
     */
    class FileWriter : public OutputStreamWriter
      {
      public:

        /**
         * @brief This method intializes a new \c FileWriter object to write to the
         * specified named file. This form of the constructor allows the caller
         * to determin whether data should be written starting at the beginning or
         * the end of the file.
         *
         * @param filename The name of the file to write to
         * @param append \c true to start adding data at the end of the
         *               file, \c false otherwise.
         */
	FileWriter(jakelib::lang::String* filename, jboolean append = false);

        /**
         * @brief This method intializes a new \c FileWriter object to write to the
         * specified named file. This form of the constructor allows the caller
         * to determin whether data should be written starting at the beginning or
         * the end of the file.
         *
         * @param filename The name of the file to write to
         * @param append \c true to start adding data at the end of the
         *               file, \c false otherwise.
         */
	FileWriter(char* filename, jboolean append = false);

        /**
         * @brief This method intializes a new \c FileWriter object to write to the
         * specified file. This form of the constructor allows the caller
         * to determin whether data should be written starting at the beginning or
         * the end of the file.
         *
         * @param file The file to write to
         * @param append \c true to start adding data at the end of the
         *               file, \c false otherwise.
         */
	FileWriter(File* file, jboolean append = false);

	JAKELIB_DECLARE_CLASS(FileWriter);
      };
  }
}
#endif

