sprint 1-alpha
sprint/io/xstream/detail/xadapter.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 *   sprint::xadapter
00003 *
00004 *   Copyright (C) 2005-2011  Paolo Medici <www.pmx.it>
00005 *
00006 *  This library is free software; you can redistribute it and/or
00007 *  modify it under the terms of the GNU Lesser General Public
00008 *  License as published by the Free Software Foundation; either
00009 *  version 2.1 of the License, or (at your option) any later version.
00010 *
00011 *  This library is distributed in the hope that it will be useful,
00012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 *  Lesser General Public License for more details.
00015 *
00016 *  You should have received a copy of the GNU Lesser General Public
00017 *  License along with this library; if not, write to the Free Software
00018 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 *
00020 *******************************************************************************/
00021 #ifndef _XVIRTUAL_ADAPTER_H
00022 #define _XVIRTUAL_ADAPTER_H
00023 
00028 #include <sprint/io/xstream/xstream.h>
00029 
00030 namespace sprint {
00031           namespace io {
00033 template<class _Io>
00034 class xadapter: public sprint::io::xstream, public _Io {
00035       public:
00036         xadapter() { }
00037         xadapter(const _Io & io) : _Io(io) { }
00038         xadapter(const char *filename, flag_t flag) : _Io(filename, flag) { }
00039         
00040         virtual ~xadapter() { }
00042         virtual int write(const char *buf, unsigned int size) { return _Io::write(buf, size); }
00044         virtual int read(char *buf, unsigned int size) { return _Io::read(buf, size); }
00046         virtual file_size_t seek(file_size_t offset, seek_t type) { return _Io::seek(offset, type); }
00048         virtual file_size_t length()  { return _Io::length(); }
00049         
00050         virtual state_t state() { return _Io::state(); }
00051         };    
00052   } // namespace io
00053 } // namespace sprint
00054 
00055 #endif
00056          
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines