debian/tmp/usr/include/conexus-0.5/conexus/file.h

00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation version 2.1.                *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Lesser General Public      *
00015  *   License along with this library; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018  ***************************************************************************/
00019 #ifndef CONEXUSFILE_H
00020 #define CONEXUSFILE_H
00021 
00022 #include <conexus/enums.h>
00023 #include <conexus/filedescriptor.h>
00024 
00029 namespace Conexus
00030   {
00031 
00038   class File : public FileDescriptor
00039     {
00040       protected:
00041         File( const std::string& filename=std::string(), long unsigned mode=FILE_READ|FILE_WRITE );
00042 
00043     public:
00044       typedef ConexusPointer<File> pointer;
00045 
00046       static File::pointer create( const std::string& filename=std::string(), long unsigned mode=FILE_READ|FILE_WRITE);
00047 
00048       virtual ~File();
00049 
00053       virtual void open(const std::string name, long unsigned mode=FILE_UNCHANGED) throw (open_exception);
00054 
00059       virtual void open() throw (open_exception);
00060 
00062       std::string filename();
00063 
00064       long unsigned mode();
00065 
00066       bool eof();
00067 
00068       bool throw_eof();
00069 
00070       void set_throw_eof(bool teof=true);
00071 
00084       void set_filename(std::string d, long unsigned mode=FILE_UNCHANGED) throw (open_exception);
00085 
00086       sigc::signal<void> signal_filename_changed();
00087 
00088       virtual const std::string& object_type() { static std::string s("Conexus::File"); return s; }
00089 
00090       protected:
00091       std::string m_filename;
00092       long unsigned m_mode;
00093       bool m_eof;
00094       bool m_throw_eof;
00095 
00096       sigc::signal<void> m_signal_filename_changed;
00097 
00098       virtual Data::pointer read_data(long int timeout, size_t s = 0) throw (read_exception);
00099 
00100     };
00101 
00102 }
00103 
00104 #endif

Generated on Tue Mar 13 19:54:43 2007 by  doxygen 1.5.1