]>
Commit | Line | Data |
---|---|---|
32fc4afb GL |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: mstream.h | |
3 | // Purpose: Memory stream classes | |
4 | // Author: Guilhem Lavaux | |
5 | // Modified by: | |
6 | // Created: 11/07/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Guilhem Lavaux | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
34138703 JS |
11 | #ifndef _WX_WXMMSTREAM_H__ |
12 | #define _WX_WXMMSTREAM_H__ | |
32fc4afb | 13 | |
79c3e0e1 | 14 | #include <wx/stream.h> |
32fc4afb | 15 | |
ce4169a4 RR |
16 | #if wxUSE_STREAMS |
17 | ||
75ed1d15 | 18 | class wxMemoryInputStream: public wxInputStream { |
18c07b73 VS |
19 | private: |
20 | size_t m_length; | |
21 | ||
32fc4afb | 22 | public: |
79c3e0e1 GL |
23 | wxMemoryInputStream(const char *data, size_t length); |
24 | virtual ~wxMemoryInputStream(); | |
18c07b73 | 25 | virtual size_t StreamSize() const { return m_length; } |
79c3e0e1 | 26 | |
32a4b1d5 | 27 | char Peek(); |
c980c992 GL |
28 | |
29 | protected: | |
30 | wxStreamBuffer *m_i_streambuf; | |
31 | ||
32 | protected: | |
33 | size_t OnSysRead(void *buffer, size_t nbytes); | |
34 | off_t OnSysSeek(off_t pos, wxSeekMode mode); | |
35 | off_t OnSysTell() const; | |
32fc4afb GL |
36 | }; |
37 | ||
75ed1d15 | 38 | class wxMemoryOutputStream: public wxOutputStream { |
32fc4afb | 39 | public: |
79c3e0e1 GL |
40 | wxMemoryOutputStream(char *data = NULL, size_t length = 0); |
41 | virtual ~wxMemoryOutputStream(); | |
c980c992 GL |
42 | |
43 | protected: | |
44 | wxStreamBuffer *m_o_streambuf; | |
45 | ||
46 | protected: | |
47 | size_t OnSysWrite(const void *buffer, size_t nbytes); | |
48 | off_t OnSysSeek(off_t pos, wxSeekMode mode); | |
49 | off_t OnSysTell() const; | |
32fc4afb GL |
50 | }; |
51 | ||
32fc4afb | 52 | #endif |
ce4169a4 RR |
53 | // wxUSE_STREAMS |
54 | ||
55 | #endif | |
cc985fac PA |
56 | // _WX_WXMMSTREAM_H__ |
57 |