]> git.saurik.com Git - wxWidgets.git/commitdiff
wx.FSFile objects should be destroyed by the user of the wxFileSystem
authorRobin Dunn <robin@alldunn.com>
Wed, 25 Aug 2004 19:31:39 +0000 (19:31 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 25 Aug 2004 19:31:39 +0000 (19:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/_filesys.i

index 87e95b556ed9fe2fe0255cf939790d7fdb7d1b0b..08b30074f2a87f1f06bacf7bc566be98e1cfa531 100644 (file)
 class wxFSFile : public wxObject
 {
 public:
 class wxFSFile : public wxObject
 {
 public:
+    %pythonAppend wxFSFile
+        "self.thisown = 0   # It will normally be deleted by the user of the wxFileSystem";
+    
     wxFSFile(wxInputStream *stream, const wxString& loc,
              const wxString& mimetype, const wxString& anchor,
              wxDateTime modif);
     wxFSFile(wxInputStream *stream, const wxString& loc,
              const wxString& mimetype, const wxString& anchor,
              wxDateTime modif);
-    ~wxFSFile();
+    
+    ~wxFSFile();  
 
     wxInputStream *GetStream();
     const wxString& GetMimeType();
 
     wxInputStream *GetStream();
     const wxString& GetMimeType();
@@ -102,6 +106,7 @@ public:
     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
     bool CanOpen(const wxString& location);
     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
     bool CanOpen(const wxString& location);
+    %newobject OpenFile;
     wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
     wxString FindFirst(const wxString& spec, int flags = 0);
     wxString FindNext();
     wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
     wxString FindFirst(const wxString& spec, int flags = 0);
     wxString FindNext();
@@ -125,6 +130,7 @@ public:
     void ChangePathTo(const wxString& location, bool is_dir = False);
     wxString GetPath();
 
     void ChangePathTo(const wxString& location, bool is_dir = False);
     wxString GetPath();
 
+    %newobject OpenFile;
     wxFSFile* OpenFile(const wxString& location);
 
     wxString FindFirst(const wxString& spec, int flags = 0);
     wxFSFile* OpenFile(const wxString& location);
 
     wxString FindFirst(const wxString& spec, int flags = 0);
@@ -157,6 +163,7 @@ class wxInternetFSHandler : public wxFileSystemHandler {
 public:
     wxInternetFSHandler();
     bool CanOpen(const wxString& location);
 public:
     wxInternetFSHandler();
     bool CanOpen(const wxString& location);
+    %newobject OpenFile;
     wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
 };
 
     wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
 };
 
@@ -168,6 +175,7 @@ public:
     wxZipFSHandler();
 
     bool CanOpen(const wxString& location);
     wxZipFSHandler();
 
     bool CanOpen(const wxString& location);
+    %newobject OpenFile;
     wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
     wxString FindFirst(const wxString& spec, int flags = 0);
     wxString FindNext();
     wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
     wxString FindFirst(const wxString& spec, int flags = 0);
     wxString FindNext();
@@ -225,6 +233,7 @@ public:
     %pythoncode { AddFile = staticmethod(MemoryFSHandler_AddFile) }
     
     bool CanOpen(const wxString& location);
     %pythoncode { AddFile = staticmethod(MemoryFSHandler_AddFile) }
     
     bool CanOpen(const wxString& location);
+    %newobject OpenFile;
     wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
     wxString FindFirst(const wxString& spec, int flags = 0);
     virtual wxString FindNext();
     wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
     wxString FindFirst(const wxString& spec, int flags = 0);
     virtual wxString FindNext();