1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wrappers to pass streams from Perl to wxWidgets
4 // (see also XS/Streams.xs)
5 // Author: Mattia Barbon
8 // RCS-ID: $Id: streams.h 2057 2007-06-18 23:03:00Z mbarbon $
9 // Copyright: (c) 2001-2002, 2004, 2006 Mattia Barbon
10 // Licence: This program is free software; you can redistribute it and/or
11 // modify it under the same terms as Perl itself
12 /////////////////////////////////////////////////////////////////////////////
14 #ifndef _WXPERL_STREAMS_H
15 #define _WXPERL_STREAMS_H
17 #include <wx/stream.h>
19 // for wxWidgets use: store a Perl object and
20 // read from/write to it using wxWidgets functions
22 class wxPliInputStream:public wxInputStream
25 wxPliInputStream():m_fh( 0 ) {}
26 wxPliInputStream( SV* fh );
27 wxPliInputStream( const wxPliInputStream& stream );
31 const wxPliInputStream& operator =( const wxPliInputStream& stream );
33 wxFileOffset GetLength() const;
34 size_t OnSysRead( void* buffer, size_t bufsize );
36 size_t GetSize() const;
38 #if WXPERL_W_VERSION_GE( 2, 5, 3 )
39 wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
40 wxFileOffset OnSysTell() const;
42 off_t OnSysSeek(off_t seek, wxSeekMode mode);
43 off_t OnSysTell() const;
49 class wxPliOutputStream:public wxOutputStream
52 wxPliOutputStream():m_fh( 0 ) {}
53 wxPliOutputStream( SV* fh );
54 wxPliOutputStream( const wxPliOutputStream& stream );
57 const wxPliOutputStream& operator = ( const wxPliOutputStream& stream );
59 wxFileOffset GetLength() const;
60 size_t OnSysWrite( const void* buffer, size_t size );
62 size_t GetSize() const;
64 #if WXPERL_W_VERSION_GE( 2, 5, 3 )
65 wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
66 wxFileOffset OnSysTell() const;
68 off_t OnSysSeek(off_t seek, wxSeekMode mode);
69 off_t OnSysTell() const;
78 // Local variables: //