]> git.saurik.com Git - wxWidgets.git/commitdiff
Add class factories for filter streams. Also filters now follow the convention
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Wed, 25 Oct 2006 20:41:12 +0000 (20:41 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Wed, 25 Oct 2006 20:41:12 +0000 (20:41 +0000)
that they own their parent if they are created with a pointer to the parent.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
Makefile.in
build/bakefiles/files.bkl
build/msw/makefile.bcc
build/msw/makefile.gcc
build/msw/makefile.vc
build/msw/makefile.wat
build/msw/wx_base.dsp
include/wx/stream.h
src/common/filtall.cpp [new file with mode: 0644]
src/common/filtfind.cpp [new file with mode: 0644]
src/common/stream.cpp
src/wxWindows.dsp

index 68d22301c97b61ac485a45fcd4c91d33ebde0c35..59da9588b0d68e78e998c4512d89cee7c53cbea6 100644 (file)
@@ -541,6 +541,8 @@ ALL_BASE_SOURCES =  \
        src/common/filefn.cpp \
        src/common/filename.cpp \
        src/common/filesys.cpp \
+       src/common/filtall.cpp \
+       src/common/filtfind.cpp \
        src/common/fmapbase.cpp \
        src/common/fs_zip.cpp \
        src/common/hash.cpp \
@@ -690,6 +692,8 @@ MONODLL_OBJECTS =  \
        monodll_filefn.o \
        monodll_filename.o \
        monodll_filesys.o \
+       monodll_filtall.o \
+       monodll_filtfind.o \
        monodll_fmapbase.o \
        monodll_fs_zip.o \
        monodll_hash.o \
@@ -783,6 +787,8 @@ MONOLIB_OBJECTS =  \
        monolib_filefn.o \
        monolib_filename.o \
        monolib_filesys.o \
+       monolib_filtall.o \
+       monolib_filtfind.o \
        monolib_fmapbase.o \
        monolib_fs_zip.o \
        monolib_hash.o \
@@ -878,6 +884,8 @@ BASEDLL_OBJECTS =  \
        basedll_filefn.o \
        basedll_filename.o \
        basedll_filesys.o \
+       basedll_filtall.o \
+       basedll_filtfind.o \
        basedll_fmapbase.o \
        basedll_fs_zip.o \
        basedll_hash.o \
@@ -956,6 +964,8 @@ BASELIB_OBJECTS =  \
        baselib_filefn.o \
        baselib_filename.o \
        baselib_filesys.o \
+       baselib_filtall.o \
+       baselib_filtfind.o \
        baselib_fmapbase.o \
        baselib_fs_zip.o \
        baselib_hash.o \
@@ -12163,6 +12173,12 @@ monodll_filename.o: $(srcdir)/src/common/filename.cpp $(MONODLL_ODEP)
 monodll_filesys.o: $(srcdir)/src/common/filesys.cpp $(MONODLL_ODEP)
        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/filesys.cpp
 
+monodll_filtall.o: $(srcdir)/src/common/filtall.cpp $(MONODLL_ODEP)
+       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/filtall.cpp
+
+monodll_filtfind.o: $(srcdir)/src/common/filtfind.cpp $(MONODLL_ODEP)
+       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/filtfind.cpp
+
 monodll_fmapbase.o: $(srcdir)/src/common/fmapbase.cpp $(MONODLL_ODEP)
        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/fmapbase.cpp
 
@@ -16231,6 +16247,12 @@ monolib_filename.o: $(srcdir)/src/common/filename.cpp $(MONOLIB_ODEP)
 monolib_filesys.o: $(srcdir)/src/common/filesys.cpp $(MONOLIB_ODEP)
        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/filesys.cpp
 
+monolib_filtall.o: $(srcdir)/src/common/filtall.cpp $(MONOLIB_ODEP)
+       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/filtall.cpp
+
+monolib_filtfind.o: $(srcdir)/src/common/filtfind.cpp $(MONOLIB_ODEP)
+       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/filtfind.cpp
+
 monolib_fmapbase.o: $(srcdir)/src/common/fmapbase.cpp $(MONOLIB_ODEP)
        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/fmapbase.cpp
 
@@ -20302,6 +20324,12 @@ basedll_filename.o: $(srcdir)/src/common/filename.cpp $(BASEDLL_ODEP)
 basedll_filesys.o: $(srcdir)/src/common/filesys.cpp $(BASEDLL_ODEP)
        $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/common/filesys.cpp
 
+basedll_filtall.o: $(srcdir)/src/common/filtall.cpp $(BASEDLL_ODEP)
+       $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/common/filtall.cpp
+
+basedll_filtfind.o: $(srcdir)/src/common/filtfind.cpp $(BASEDLL_ODEP)
+       $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/common/filtfind.cpp
+
 basedll_fmapbase.o: $(srcdir)/src/common/fmapbase.cpp $(BASEDLL_ODEP)
        $(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/common/fmapbase.cpp
 
@@ -20869,6 +20897,12 @@ baselib_filename.o: $(srcdir)/src/common/filename.cpp $(BASELIB_ODEP)
 baselib_filesys.o: $(srcdir)/src/common/filesys.cpp $(BASELIB_ODEP)
        $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/common/filesys.cpp
 
+baselib_filtall.o: $(srcdir)/src/common/filtall.cpp $(BASELIB_ODEP)
+       $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/common/filtall.cpp
+
+baselib_filtfind.o: $(srcdir)/src/common/filtfind.cpp $(BASELIB_ODEP)
+       $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/common/filtfind.cpp
+
 baselib_fmapbase.o: $(srcdir)/src/common/fmapbase.cpp $(BASELIB_ODEP)
        $(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/common/fmapbase.cpp
 
index dd6961cf2d77d17dec715a544c6f18552ca7d990..763cb4b06f9db1103dad61657550b8a950d341d6 100644 (file)
@@ -309,6 +309,8 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/common/filefn.cpp
     src/common/filename.cpp
     src/common/filesys.cpp
+    src/common/filtall.cpp
+    src/common/filtfind.cpp
     src/common/fmapbase.cpp
     src/common/fs_zip.cpp
     src/common/hash.cpp
index 7b64b71a2ad585e53fd7648e04565f0260fe7d20..cfd5cdb293f5d090b399a4d7fc29d3d6fba8f8bc 100644 (file)
@@ -223,6 +223,8 @@ MONODLL_OBJECTS =  \
        $(OBJS)\monodll_filefn.obj \
        $(OBJS)\monodll_filename.obj \
        $(OBJS)\monodll_filesys.obj \
+       $(OBJS)\monodll_filtall.obj \
+       $(OBJS)\monodll_filtfind.obj \
        $(OBJS)\monodll_fmapbase.obj \
        $(OBJS)\monodll_fs_zip.obj \
        $(OBJS)\monodll_hash.obj \
@@ -337,6 +339,8 @@ MONOLIB_OBJECTS =  \
        $(OBJS)\monolib_filefn.obj \
        $(OBJS)\monolib_filename.obj \
        $(OBJS)\monolib_filesys.obj \
+       $(OBJS)\monolib_filtall.obj \
+       $(OBJS)\monolib_filtfind.obj \
        $(OBJS)\monolib_fmapbase.obj \
        $(OBJS)\monolib_fs_zip.obj \
        $(OBJS)\monolib_hash.obj \
@@ -452,6 +456,8 @@ BASEDLL_OBJECTS =  \
        $(OBJS)\basedll_filefn.obj \
        $(OBJS)\basedll_filename.obj \
        $(OBJS)\basedll_filesys.obj \
+       $(OBJS)\basedll_filtall.obj \
+       $(OBJS)\basedll_filtfind.obj \
        $(OBJS)\basedll_fmapbase.obj \
        $(OBJS)\basedll_fs_zip.obj \
        $(OBJS)\basedll_hash.obj \
@@ -551,6 +557,8 @@ BASELIB_OBJECTS =  \
        $(OBJS)\baselib_filefn.obj \
        $(OBJS)\baselib_filename.obj \
        $(OBJS)\baselib_filesys.obj \
+       $(OBJS)\baselib_filtall.obj \
+       $(OBJS)\baselib_filtfind.obj \
        $(OBJS)\baselib_fmapbase.obj \
        $(OBJS)\baselib_fs_zip.obj \
        $(OBJS)\baselib_hash.obj \
@@ -4524,6 +4532,12 @@ $(OBJS)\monodll_filename.obj: ..\..\src\common\filename.cpp
 $(OBJS)\monodll_filesys.obj: ..\..\src\common\filesys.cpp
        $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
 
+$(OBJS)\monodll_filtall.obj: ..\..\src\common\filtall.cpp
+       $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
+
+$(OBJS)\monodll_filtfind.obj: ..\..\src\common\filtfind.cpp
+       $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
+
 $(OBJS)\monodll_fmapbase.obj: ..\..\src\common\fmapbase.cpp
        $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
 
@@ -6474,6 +6488,12 @@ $(OBJS)\monolib_filename.obj: ..\..\src\common\filename.cpp
 $(OBJS)\monolib_filesys.obj: ..\..\src\common\filesys.cpp
        $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
 
+$(OBJS)\monolib_filtall.obj: ..\..\src\common\filtall.cpp
+       $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
+
+$(OBJS)\monolib_filtfind.obj: ..\..\src\common\filtfind.cpp
+       $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
+
 $(OBJS)\monolib_fmapbase.obj: ..\..\src\common\fmapbase.cpp
        $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
 
@@ -8427,6 +8447,12 @@ $(OBJS)\basedll_filename.obj: ..\..\src\common\filename.cpp
 $(OBJS)\basedll_filesys.obj: ..\..\src\common\filesys.cpp
        $(CXX) -q -c -P -o$@ $(BASEDLL_CXXFLAGS) $**
 
+$(OBJS)\basedll_filtall.obj: ..\..\src\common\filtall.cpp
+       $(CXX) -q -c -P -o$@ $(BASEDLL_CXXFLAGS) $**
+
+$(OBJS)\basedll_filtfind.obj: ..\..\src\common\filtfind.cpp
+       $(CXX) -q -c -P -o$@ $(BASEDLL_CXXFLAGS) $**
+
 $(OBJS)\basedll_fmapbase.obj: ..\..\src\common\fmapbase.cpp
        $(CXX) -q -c -P -o$@ $(BASEDLL_CXXFLAGS) $**
 
@@ -8676,6 +8702,12 @@ $(OBJS)\baselib_filename.obj: ..\..\src\common\filename.cpp
 $(OBJS)\baselib_filesys.obj: ..\..\src\common\filesys.cpp
        $(CXX) -q -c -P -o$@ $(BASELIB_CXXFLAGS) $**
 
+$(OBJS)\baselib_filtall.obj: ..\..\src\common\filtall.cpp
+       $(CXX) -q -c -P -o$@ $(BASELIB_CXXFLAGS) $**
+
+$(OBJS)\baselib_filtfind.obj: ..\..\src\common\filtfind.cpp
+       $(CXX) -q -c -P -o$@ $(BASELIB_CXXFLAGS) $**
+
 $(OBJS)\baselib_fmapbase.obj: ..\..\src\common\fmapbase.cpp
        $(CXX) -q -c -P -o$@ $(BASELIB_CXXFLAGS) $**
 
index 25182e46fc51247196da9fd923a1fa0d73364368..2c33ab44ffa7d7611375d937ec8f1dfdc2f89d85 100644 (file)
@@ -209,6 +209,8 @@ MONODLL_OBJECTS =  \
        $(OBJS)\monodll_filefn.o \
        $(OBJS)\monodll_filename.o \
        $(OBJS)\monodll_filesys.o \
+       $(OBJS)\monodll_filtall.o \
+       $(OBJS)\monodll_filtfind.o \
        $(OBJS)\monodll_fmapbase.o \
        $(OBJS)\monodll_fs_zip.o \
        $(OBJS)\monodll_hash.o \
@@ -323,6 +325,8 @@ MONOLIB_OBJECTS =  \
        $(OBJS)\monolib_filefn.o \
        $(OBJS)\monolib_filename.o \
        $(OBJS)\monolib_filesys.o \
+       $(OBJS)\monolib_filtall.o \
+       $(OBJS)\monolib_filtfind.o \
        $(OBJS)\monolib_fmapbase.o \
        $(OBJS)\monolib_fs_zip.o \
        $(OBJS)\monolib_hash.o \
@@ -439,6 +443,8 @@ BASEDLL_OBJECTS =  \
        $(OBJS)\basedll_filefn.o \
        $(OBJS)\basedll_filename.o \
        $(OBJS)\basedll_filesys.o \
+       $(OBJS)\basedll_filtall.o \
+       $(OBJS)\basedll_filtfind.o \
        $(OBJS)\basedll_fmapbase.o \
        $(OBJS)\basedll_fs_zip.o \
        $(OBJS)\basedll_hash.o \
@@ -538,6 +544,8 @@ BASELIB_OBJECTS =  \
        $(OBJS)\baselib_filefn.o \
        $(OBJS)\baselib_filename.o \
        $(OBJS)\baselib_filesys.o \
+       $(OBJS)\baselib_filtall.o \
+       $(OBJS)\baselib_filtfind.o \
        $(OBJS)\baselib_fmapbase.o \
        $(OBJS)\baselib_fs_zip.o \
        $(OBJS)\baselib_hash.o \
@@ -4641,6 +4649,12 @@ $(OBJS)\monodll_filename.o: ../../src/common/filename.cpp
 $(OBJS)\monodll_filesys.o: ../../src/common/filesys.cpp
        $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
 
+$(OBJS)\monodll_filtall.o: ../../src/common/filtall.cpp
+       $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+
+$(OBJS)\monodll_filtfind.o: ../../src/common/filtfind.cpp
+       $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+
 $(OBJS)\monodll_fmapbase.o: ../../src/common/fmapbase.cpp
        $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
 
@@ -6691,6 +6705,12 @@ $(OBJS)\monolib_filename.o: ../../src/common/filename.cpp
 $(OBJS)\monolib_filesys.o: ../../src/common/filesys.cpp
        $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
 
+$(OBJS)\monolib_filtall.o: ../../src/common/filtall.cpp
+       $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+
+$(OBJS)\monolib_filtfind.o: ../../src/common/filtfind.cpp
+       $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+
 $(OBJS)\monolib_fmapbase.o: ../../src/common/fmapbase.cpp
        $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
 
@@ -8744,6 +8764,12 @@ $(OBJS)\basedll_filename.o: ../../src/common/filename.cpp
 $(OBJS)\basedll_filesys.o: ../../src/common/filesys.cpp
        $(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $<
 
+$(OBJS)\basedll_filtall.o: ../../src/common/filtall.cpp
+       $(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $<
+
+$(OBJS)\basedll_filtfind.o: ../../src/common/filtfind.cpp
+       $(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $<
+
 $(OBJS)\basedll_fmapbase.o: ../../src/common/fmapbase.cpp
        $(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $<
 
@@ -8993,6 +9019,12 @@ $(OBJS)\baselib_filename.o: ../../src/common/filename.cpp
 $(OBJS)\baselib_filesys.o: ../../src/common/filesys.cpp
        $(CXX) -c -o $@ $(BASELIB_CXXFLAGS) $(CPPDEPS) $<
 
+$(OBJS)\baselib_filtall.o: ../../src/common/filtall.cpp
+       $(CXX) -c -o $@ $(BASELIB_CXXFLAGS) $(CPPDEPS) $<
+
+$(OBJS)\baselib_filtfind.o: ../../src/common/filtfind.cpp
+       $(CXX) -c -o $@ $(BASELIB_CXXFLAGS) $(CPPDEPS) $<
+
 $(OBJS)\baselib_fmapbase.o: ../../src/common/fmapbase.cpp
        $(CXX) -c -o $@ $(BASELIB_CXXFLAGS) $(CPPDEPS) $<
 
index c21b1b80fd35512670eeb4edd23216729bc1508a..17b6295b4bd28fa7f519706883bcd3b1d9b4ff99 100644 (file)
@@ -224,6 +224,8 @@ MONODLL_OBJECTS =  \
        $(OBJS)\monodll_filefn.obj \
        $(OBJS)\monodll_filename.obj \
        $(OBJS)\monodll_filesys.obj \
+       $(OBJS)\monodll_filtall.obj \
+       $(OBJS)\monodll_filtfind.obj \
        $(OBJS)\monodll_fmapbase.obj \
        $(OBJS)\monodll_fs_zip.obj \
        $(OBJS)\monodll_hash.obj \
@@ -343,6 +345,8 @@ MONOLIB_OBJECTS =  \
        $(OBJS)\monolib_filefn.obj \
        $(OBJS)\monolib_filename.obj \
        $(OBJS)\monolib_filesys.obj \
+       $(OBJS)\monolib_filtall.obj \
+       $(OBJS)\monolib_filtfind.obj \
        $(OBJS)\monolib_fmapbase.obj \
        $(OBJS)\monolib_fs_zip.obj \
        $(OBJS)\monolib_hash.obj \
@@ -464,6 +468,8 @@ BASEDLL_OBJECTS =  \
        $(OBJS)\basedll_filefn.obj \
        $(OBJS)\basedll_filename.obj \
        $(OBJS)\basedll_filesys.obj \
+       $(OBJS)\basedll_filtall.obj \
+       $(OBJS)\basedll_filtfind.obj \
        $(OBJS)\basedll_fmapbase.obj \
        $(OBJS)\basedll_fs_zip.obj \
        $(OBJS)\basedll_hash.obj \
@@ -569,6 +575,8 @@ BASELIB_OBJECTS =  \
        $(OBJS)\baselib_filefn.obj \
        $(OBJS)\baselib_filename.obj \
        $(OBJS)\baselib_filesys.obj \
+       $(OBJS)\baselib_filtall.obj \
+       $(OBJS)\baselib_filtfind.obj \
        $(OBJS)\baselib_fmapbase.obj \
        $(OBJS)\baselib_fs_zip.obj \
        $(OBJS)\baselib_hash.obj \
@@ -4857,6 +4865,12 @@ $(OBJS)\monodll_filename.obj: ..\..\src\common\filename.cpp
 $(OBJS)\monodll_filesys.obj: ..\..\src\common\filesys.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
 
+$(OBJS)\monodll_filtall.obj: ..\..\src\common\filtall.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
+
+$(OBJS)\monodll_filtfind.obj: ..\..\src\common\filtfind.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
+
 $(OBJS)\monodll_fmapbase.obj: ..\..\src\common\fmapbase.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
 
@@ -6807,6 +6821,12 @@ $(OBJS)\monolib_filename.obj: ..\..\src\common\filename.cpp
 $(OBJS)\monolib_filesys.obj: ..\..\src\common\filesys.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
 
+$(OBJS)\monolib_filtall.obj: ..\..\src\common\filtall.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
+
+$(OBJS)\monolib_filtfind.obj: ..\..\src\common\filtfind.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
+
 $(OBJS)\monolib_fmapbase.obj: ..\..\src\common\fmapbase.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
 
@@ -8760,6 +8780,12 @@ $(OBJS)\basedll_filename.obj: ..\..\src\common\filename.cpp
 $(OBJS)\basedll_filesys.obj: ..\..\src\common\filesys.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) $**
 
+$(OBJS)\basedll_filtall.obj: ..\..\src\common\filtall.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) $**
+
+$(OBJS)\basedll_filtfind.obj: ..\..\src\common\filtfind.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) $**
+
 $(OBJS)\basedll_fmapbase.obj: ..\..\src\common\fmapbase.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) $**
 
@@ -9009,6 +9035,12 @@ $(OBJS)\baselib_filename.obj: ..\..\src\common\filename.cpp
 $(OBJS)\baselib_filesys.obj: ..\..\src\common\filesys.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(BASELIB_CXXFLAGS) $**
 
+$(OBJS)\baselib_filtall.obj: ..\..\src\common\filtall.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(BASELIB_CXXFLAGS) $**
+
+$(OBJS)\baselib_filtfind.obj: ..\..\src\common\filtfind.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(BASELIB_CXXFLAGS) $**
+
 $(OBJS)\baselib_fmapbase.obj: ..\..\src\common\fmapbase.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(BASELIB_CXXFLAGS) $**
 
index c8899666dabaf5b123c910321ceeda3eecad70d6..16fcfcd992ce67404c3f8129d123b79e537c1a85 100644 (file)
@@ -2918,6 +2918,8 @@ MONODLL_OBJECTS =  &
        $(OBJS)\monodll_filefn.obj &
        $(OBJS)\monodll_filename.obj &
        $(OBJS)\monodll_filesys.obj &
+       $(OBJS)\monodll_filtall.obj &
+       $(OBJS)\monodll_filtfind.obj &
        $(OBJS)\monodll_fmapbase.obj &
        $(OBJS)\monodll_fs_zip.obj &
        $(OBJS)\monodll_hash.obj &
@@ -3032,6 +3034,8 @@ MONOLIB_OBJECTS =  &
        $(OBJS)\monolib_filefn.obj &
        $(OBJS)\monolib_filename.obj &
        $(OBJS)\monolib_filesys.obj &
+       $(OBJS)\monolib_filtall.obj &
+       $(OBJS)\monolib_filtfind.obj &
        $(OBJS)\monolib_fmapbase.obj &
        $(OBJS)\monolib_fs_zip.obj &
        $(OBJS)\monolib_hash.obj &
@@ -3148,6 +3152,8 @@ BASEDLL_OBJECTS =  &
        $(OBJS)\basedll_filefn.obj &
        $(OBJS)\basedll_filename.obj &
        $(OBJS)\basedll_filesys.obj &
+       $(OBJS)\basedll_filtall.obj &
+       $(OBJS)\basedll_filtfind.obj &
        $(OBJS)\basedll_fmapbase.obj &
        $(OBJS)\basedll_fs_zip.obj &
        $(OBJS)\basedll_hash.obj &
@@ -3248,6 +3254,8 @@ BASELIB_OBJECTS =  &
        $(OBJS)\baselib_filefn.obj &
        $(OBJS)\baselib_filename.obj &
        $(OBJS)\baselib_filesys.obj &
+       $(OBJS)\baselib_filtall.obj &
+       $(OBJS)\baselib_filtfind.obj &
        $(OBJS)\baselib_fmapbase.obj &
        $(OBJS)\baselib_fs_zip.obj &
        $(OBJS)\baselib_hash.obj &
@@ -4869,6 +4877,12 @@ $(OBJS)\monodll_filename.obj :  .AUTODEPEND ..\..\src\common\filename.cpp
 $(OBJS)\monodll_filesys.obj :  .AUTODEPEND ..\..\src\common\filesys.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
 
+$(OBJS)\monodll_filtall.obj :  .AUTODEPEND ..\..\src\common\filtall.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+
+$(OBJS)\monodll_filtfind.obj :  .AUTODEPEND ..\..\src\common\filtfind.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+
 $(OBJS)\monodll_fmapbase.obj :  .AUTODEPEND ..\..\src\common\fmapbase.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
 
@@ -6919,6 +6933,12 @@ $(OBJS)\monolib_filename.obj :  .AUTODEPEND ..\..\src\common\filename.cpp
 $(OBJS)\monolib_filesys.obj :  .AUTODEPEND ..\..\src\common\filesys.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
 
+$(OBJS)\monolib_filtall.obj :  .AUTODEPEND ..\..\src\common\filtall.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+
+$(OBJS)\monolib_filtfind.obj :  .AUTODEPEND ..\..\src\common\filtfind.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+
 $(OBJS)\monolib_fmapbase.obj :  .AUTODEPEND ..\..\src\common\fmapbase.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
 
@@ -8972,6 +8992,12 @@ $(OBJS)\basedll_filename.obj :  .AUTODEPEND ..\..\src\common\filename.cpp
 $(OBJS)\basedll_filesys.obj :  .AUTODEPEND ..\..\src\common\filesys.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(BASEDLL_CXXFLAGS) $<
 
+$(OBJS)\basedll_filtall.obj :  .AUTODEPEND ..\..\src\common\filtall.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(BASEDLL_CXXFLAGS) $<
+
+$(OBJS)\basedll_filtfind.obj :  .AUTODEPEND ..\..\src\common\filtfind.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(BASEDLL_CXXFLAGS) $<
+
 $(OBJS)\basedll_fmapbase.obj :  .AUTODEPEND ..\..\src\common\fmapbase.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(BASEDLL_CXXFLAGS) $<
 
@@ -9221,6 +9247,12 @@ $(OBJS)\baselib_filename.obj :  .AUTODEPEND ..\..\src\common\filename.cpp
 $(OBJS)\baselib_filesys.obj :  .AUTODEPEND ..\..\src\common\filesys.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(BASELIB_CXXFLAGS) $<
 
+$(OBJS)\baselib_filtall.obj :  .AUTODEPEND ..\..\src\common\filtall.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(BASELIB_CXXFLAGS) $<
+
+$(OBJS)\baselib_filtfind.obj :  .AUTODEPEND ..\..\src\common\filtfind.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(BASELIB_CXXFLAGS) $<
+
 $(OBJS)\baselib_fmapbase.obj :  .AUTODEPEND ..\..\src\common\fmapbase.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(BASELIB_CXXFLAGS) $<
 
index fd3c321ad210d4be39026b244d8802b0287d3830..76dd165f7087f61ebcb28b061776cc7bdcb5d16e 100644 (file)
@@ -547,6 +547,14 @@ SOURCE=..\..\src\common\filesys.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\src\common\filtall.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\common\filtfind.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\src\common\fmapbase.cpp
 # End Source File
 # Begin Source File
index 652c40481f17a5080742209af9c68e09d5947d03..6d3da3c9146c6e7bc4bbbd9d42e7a4eb309317a9 100644 (file)
@@ -288,6 +288,7 @@ class WXDLLIMPEXP_BASE wxFilterInputStream : public wxInputStream
 public:
     wxFilterInputStream();
     wxFilterInputStream(wxInputStream& stream);
+    wxFilterInputStream(wxInputStream *stream);
     virtual ~wxFilterInputStream();
 
     char Peek() { return m_parent_i_stream->Peek(); }
@@ -298,6 +299,7 @@ public:
 
 protected:
     wxInputStream *m_parent_i_stream;
+    bool m_owns;
 
     DECLARE_NO_COPY_CLASS(wxFilterInputStream)
 };
@@ -307,18 +309,74 @@ class WXDLLIMPEXP_BASE wxFilterOutputStream : public wxOutputStream
 public:
     wxFilterOutputStream();
     wxFilterOutputStream(wxOutputStream& stream);
+    wxFilterOutputStream(wxOutputStream *stream);
     virtual ~wxFilterOutputStream();
 
     wxFileOffset GetLength() const { return m_parent_o_stream->GetLength(); }
 
     wxOutputStream *GetFilterOutputStream() const { return m_parent_o_stream; }
 
+    bool Close();
+
 protected:
     wxOutputStream *m_parent_o_stream;
+    bool m_owns;
 
     DECLARE_NO_COPY_CLASS(wxFilterOutputStream)
 };
 
+enum wxStreamProtocolType
+{
+    wxSTREAM_PROTOCOL,      // wxFileSystem protocol (should be only one)
+    wxSTREAM_MIMETYPE,      // Mime types the stream handles
+    wxSTREAM_ENCODING,      // The http Content-Encodings the stream handles
+    wxSTREAM_FILEEXTENSION  // File extensions the stream handles
+};
+
+void WXDLLIMPEXP_BASE wxUseFilterClasses();
+
+class WXDLLIMPEXP_BASE wxFilterClassFactory : public wxObject
+{
+public:
+    virtual ~wxFilterClassFactory() { }
+
+    virtual wxFilterInputStream  *NewStream(wxInputStream& stream)  const = 0;
+    virtual wxFilterOutputStream *NewStream(wxOutputStream& stream) const = 0;
+    virtual wxFilterInputStream  *NewStream(wxInputStream *stream)  const = 0;
+    virtual wxFilterOutputStream *NewStream(wxOutputStream *stream) const = 0;
+
+    wxString GetProtocol() const { return wxString(*GetProtocols()); }
+
+    virtual const wxChar * const *GetProtocols(wxStreamProtocolType type
+                                               = wxSTREAM_PROTOCOL) const = 0;
+
+    bool CanHandle(const wxChar *protocol,
+                   wxStreamProtocolType type
+                   = wxSTREAM_PROTOCOL) const;
+
+    static const wxFilterClassFactory *Find(const wxChar *protocol,
+                                            wxStreamProtocolType type
+                                            = wxSTREAM_PROTOCOL);
+
+    static const wxFilterClassFactory *GetFirst();
+    const wxFilterClassFactory *GetNext() const { return m_next; }
+
+    void PushFront() { Remove(); m_next = sm_first; sm_first = this; }
+    void Remove();
+
+protected:
+    wxFilterClassFactory() : m_next(this) { }
+
+    wxFilterClassFactory& operator=(const wxFilterClassFactory&)
+        { return *this; }
+
+private:
+    static wxFilterClassFactory *sm_first;
+    wxFilterClassFactory *m_next;
+
+    DECLARE_ABSTRACT_CLASS(wxFilterClassFactory)
+};
+
 // ============================================================================
 // buffered streams
 // ============================================================================
diff --git a/src/common/filtall.cpp b/src/common/filtall.cpp
new file mode 100644 (file)
index 0000000..7dab767
--- /dev/null
@@ -0,0 +1,36 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/common/filtall.cpp
+// Purpose:     Link all filter streams
+// Author:      Mike Wetherell
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 Mike Wetherell
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#if wxUSE_STREAMS
+
+#if wxUSE_ZLIB
+#include "wx/zstream.h"
+#endif
+
+// Reference filter classes to ensure they are linked into a statically
+// linked program that uses Find or GetFirst to look for an filter handler.
+// It is in its own file so that the user can override this behaviour by
+// providing their own implementation.
+
+void wxUseFilterClasses()
+{
+#if wxUSE_ZLIB
+    wxZlibClassFactory();
+    wxGzipClassFactory();
+#endif
+}
+
+#endif // wxUSE_STREAMS
diff --git a/src/common/filtfind.cpp b/src/common/filtfind.cpp
new file mode 100644 (file)
index 0000000..bd7d5a6
--- /dev/null
@@ -0,0 +1,43 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/common/filtfind.cpp
+// Purpose:     Streams for filter formats
+// Author:      Mike Wetherell
+// RCS-ID:      $Id$
+// Copyright:   (c) Mike Wetherell
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#if wxUSE_STREAMS
+
+#include "wx/stream.h"
+
+// These functions are in a separate file so that statically linked apps
+// that do not call them to search for filter handlers will only link in
+// the filter classes they use.
+
+const wxFilterClassFactory *
+wxFilterClassFactory::Find(const wxChar *protocol, wxStreamProtocolType type)
+{
+    for (const wxFilterClassFactory *f = GetFirst(); f; f = f->GetNext())
+        if (f->CanHandle(protocol, type))
+            return f;
+
+    return NULL;
+}
+
+// static
+const wxFilterClassFactory *wxFilterClassFactory::GetFirst()
+{
+    if (!sm_first)
+        wxUseFilterClasses();
+    return sm_first;
+}
+
+#endif // wxUSE_STREAMS
index 18bcc6f518478364b5e9b22848d3fd3aa71fcfdc..618ae6ed322cf7138a15cbc0ea55247c8de0a695 100644 (file)
@@ -1046,17 +1046,27 @@ wxFileOffset wxCountingOutputStream::OnSysTell() const
 // ----------------------------------------------------------------------------
 
 wxFilterInputStream::wxFilterInputStream()
+ :  m_parent_i_stream(NULL),
+    m_owns(false)
 {
-    m_parent_i_stream = NULL;
 }
 
 wxFilterInputStream::wxFilterInputStream(wxInputStream& stream)
+ :  m_parent_i_stream(&stream),
+    m_owns(false)
+{
+}
+
+wxFilterInputStream::wxFilterInputStream(wxInputStream *stream)
+ :  m_parent_i_stream(stream),
+    m_owns(true)
 {
-    m_parent_i_stream = &stream;
 }
 
 wxFilterInputStream::~wxFilterInputStream()
 {
+    if (m_owns)
+        delete m_parent_i_stream;
 }
 
 // ----------------------------------------------------------------------------
@@ -1064,17 +1074,83 @@ wxFilterInputStream::~wxFilterInputStream()
 // ----------------------------------------------------------------------------
 
 wxFilterOutputStream::wxFilterOutputStream()
+ :  m_parent_o_stream(NULL),
+    m_owns(false)
 {
-    m_parent_o_stream = NULL;
 }
 
 wxFilterOutputStream::wxFilterOutputStream(wxOutputStream& stream)
+ :  m_parent_o_stream(&stream),
+    m_owns(false)
+{
+}
+
+wxFilterOutputStream::wxFilterOutputStream(wxOutputStream *stream)
+ :  m_parent_o_stream(stream),
+    m_owns(true)
+{
+}
+
+bool wxFilterOutputStream::Close()
 {
-    m_parent_o_stream = &stream;
+    if (m_parent_o_stream && m_owns)
+        return m_parent_o_stream->Close();
+    else
+        return true;
 }
 
 wxFilterOutputStream::~wxFilterOutputStream()
 {
+    if (m_owns)
+        delete m_parent_o_stream;
+}
+
+// ----------------------------------------------------------------------------
+// wxFilterClassFactory
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxFilterClassFactory, wxObject)
+
+wxFilterClassFactory *wxFilterClassFactory::sm_first = NULL;
+
+bool wxFilterClassFactory::CanHandle(const wxChar *protocol,
+                                     wxStreamProtocolType type) const
+{
+    if (type == wxSTREAM_FILEEXTENSION)
+    {
+        size_t len = wxStrlen(protocol);
+
+        for (const wxChar * const *p = GetProtocols(type); p && *p; p++)
+        {
+            size_t l = wxStrlen(*p);
+
+            if (l <= len && wxStrcmp(*p, protocol + len - l) == 0)
+                return true;
+        }
+    }
+    else
+    {
+        for (const wxChar * const *p = GetProtocols(type); p && *p; p++)
+            if (wxStrcmp(*p, protocol) == 0)
+                return true;
+    }
+
+    return false;
+}
+
+void wxFilterClassFactory::Remove()
+{
+    if (m_next != this)
+    {
+        wxFilterClassFactory **pp = &sm_first;
+
+        while (*pp != this)
+            pp = &(*pp)->m_next;
+
+        *pp = m_next;
+
+        m_next = this;
+    }
 }
 
 // ----------------------------------------------------------------------------
index 34e01edce064162219a12ed26cacb698851172c2..27e5643fc7103e9ef44c0d72751837ee0baf8217 100644 (file)
@@ -543,6 +543,14 @@ SOURCE=.\common\filesys.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\common\filtall.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\common\filtfind.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\common\fldlgcmn.cpp
 # End Source File
 # Begin Source File