00001 00005 00006 // 00007 // Copyright (c) 2003-2004 California Institute of Technology 00008 // Copyright (c) 2004-2007 University of Southern California 00009 // Rob Peters <rjpeters at usc dot edu> 00010 // 00011 // created: Fri May 23 10:01:57 2003 00012 // commit: $Id: outputfile.h 10065 2007-04-12 05:54:56Z rjpeters $ 00013 // $HeadURL: file:///lab/rjpeters/svnrepo/code/trunk/groovx/src/io/outputfile.h $ 00014 // 00015 // -------------------------------------------------------------------- 00016 // 00017 // This file is part of GroovX. 00018 // [http://ilab.usc.edu/rjpeters/groovx/] 00019 // 00020 // GroovX is free software; you can redistribute it and/or modify it 00021 // under the terms of the GNU General Public License as published by 00022 // the Free Software Foundation; either version 2 of the License, or 00023 // (at your option) any later version. 00024 // 00025 // GroovX is distributed in the hope that it will be useful, but 00026 // WITHOUT ANY WARRANTY; without even the implied warranty of 00027 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00028 // General Public License for more details. 00029 // 00030 // You should have received a copy of the GNU General Public License 00031 // along with GroovX; if not, write to the Free Software Foundation, 00032 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00033 // 00035 00036 #ifndef GROOVX_IO_OUTPUTFILE_H_UTC20050626084021_DEFINED 00037 #define GROOVX_IO_OUTPUTFILE_H_UTC20050626084021_DEFINED 00038 00039 #include "io/io.h" 00040 00041 #include "rutz/fstring.h" 00042 #include "rutz/shared_ptr.h" 00043 00044 #include <iosfwd> 00045 00047 00049 class output_file : public io::serializable 00050 { 00051 protected: 00052 output_file(); 00053 00054 virtual ~output_file() throw(); 00055 00056 public: 00058 static output_file* make() { return new output_file; } 00059 00060 virtual void read_from(io::reader& reader); 00061 virtual void write_to(io::writer& writer) const; 00062 00064 rutz::fstring get_filename() const; 00065 00067 void set_filename(rutz::fstring fname); 00068 00070 bool has_stream() const; 00071 00073 std::ostream& stream(); 00074 00075 private: 00076 rutz::fstring m_filename; 00077 rutz::shared_ptr<std::ostream> m_stream; 00078 }; 00079 00080 static const char __attribute__((used)) vcid_groovx_io_outputfile_h_utc20050626084021[] = "$Id: outputfile.h 10065 2007-04-12 05:54:56Z rjpeters $ $HeadURL: file: 00081 #endif // !GROOVX_IO_OUTPUTFILE_H_UTC20050626084021_DEFINED