]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/objstrm.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxObjectStream classes
4 // Author: Guilhem Lavaux
8 // Copyright: (c) 1998 Guilhem Lavaux
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __WXOBJSTRM_H__
12 #define __WXOBJSTRM_H__
19 #include "wx/object.h"
20 #include "wx/string.h"
21 #include "wx/stream.h"
23 class wxObjectStreamInfo
: public wxObject
{
32 class wxObjectOutputStream
: public wxFilterOutputStream
{
34 wxObjectOutputStream(wxOutputStream
& s
);
36 void AddChild(wxObject
*obj
);
37 bool SaveObject(wxObject
& obj
);
39 bool FirstStage() const { return m_stage
== 0; }
41 wxString
GetObjectName(wxObject
*obj
);
44 void WriteObjectDef(wxObjectStreamInfo
& info
);
45 void ProcessObjectDef(wxObjectStreamInfo
*info
);
46 void ProcessObjectData(wxObjectStreamInfo
*info
);
51 wxObjectStreamInfo
*m_current_info
;
54 class wxObjectInputStream
: public wxFilterInputStream
{
56 wxObjectInputStream(wxInputStream
& s
);
58 wxObject
*GetChild(int no
) const;
59 wxObject
*GetParent() const { return m_current_info
->parent
; }
60 wxObject
*LoadObject();
62 wxObject
*SolveName(const wxString
& objName
) const;
65 bool ReadObjectDef(wxObjectStreamInfo
*info
);
66 wxObjectStreamInfo
*ProcessObjectDef(wxObjectStreamInfo
*info
);
67 void ProcessObjectData(wxObjectStreamInfo
*info
);
70 wxObjectStreamInfo
*m_current_info
;