Merge branch 'remove-wxstring-impl'
Remove wxStringImpl and always assume wxUSE_STD_STRING==1. See #22976.
This commit is contained in:
commit
aa9e68178e
50 changed files with 211 additions and 2375 deletions
19
Makefile.in
19
Makefile.in
|
|
@ -538,7 +538,6 @@ ALL_BASE_HEADERS = \
|
|||
wx/strconv.h \
|
||||
wx/stream.h \
|
||||
wx/string.h \
|
||||
wx/stringimpl.h \
|
||||
wx/stringops.h \
|
||||
wx/strvararg.h \
|
||||
wx/sysopt.h \
|
||||
|
|
@ -725,7 +724,6 @@ ALL_PORTS_BASE_HEADERS = \
|
|||
wx/strconv.h \
|
||||
wx/stream.h \
|
||||
wx/string.h \
|
||||
wx/stringimpl.h \
|
||||
wx/stringops.h \
|
||||
wx/strvararg.h \
|
||||
wx/sysopt.h \
|
||||
|
|
@ -891,7 +889,6 @@ ALL_BASE_SOURCES = \
|
|||
src/common/strconv.cpp \
|
||||
src/common/stream.cpp \
|
||||
src/common/string.cpp \
|
||||
src/common/stringimpl.cpp \
|
||||
src/common/stringops.cpp \
|
||||
src/common/strvararg.cpp \
|
||||
src/common/sysopt.cpp \
|
||||
|
|
@ -1084,7 +1081,6 @@ MONODLL_OBJECTS = \
|
|||
monodll_strconv.o \
|
||||
monodll_stream.o \
|
||||
monodll_string.o \
|
||||
monodll_stringimpl.o \
|
||||
monodll_stringops.o \
|
||||
monodll_strvararg.o \
|
||||
monodll_sysopt.o \
|
||||
|
|
@ -1231,7 +1227,6 @@ MONOLIB_OBJECTS = \
|
|||
monolib_strconv.o \
|
||||
monolib_stream.o \
|
||||
monolib_string.o \
|
||||
monolib_stringimpl.o \
|
||||
monolib_stringops.o \
|
||||
monolib_strvararg.o \
|
||||
monolib_sysopt.o \
|
||||
|
|
@ -1362,7 +1357,6 @@ BASEDLL_OBJECTS = \
|
|||
basedll_strconv.o \
|
||||
basedll_stream.o \
|
||||
basedll_string.o \
|
||||
basedll_stringimpl.o \
|
||||
basedll_stringops.o \
|
||||
basedll_strvararg.o \
|
||||
basedll_sysopt.o \
|
||||
|
|
@ -1475,7 +1469,6 @@ BASELIB_OBJECTS = \
|
|||
baselib_strconv.o \
|
||||
baselib_stream.o \
|
||||
baselib_string.o \
|
||||
baselib_stringimpl.o \
|
||||
baselib_stringops.o \
|
||||
baselib_strvararg.o \
|
||||
baselib_sysopt.o \
|
||||
|
|
@ -14804,9 +14797,6 @@ monodll_stream.o: $(srcdir)/src/common/stream.cpp $(MONODLL_ODEP)
|
|||
monodll_string.o: $(srcdir)/src/common/string.cpp $(MONODLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/string.cpp
|
||||
|
||||
monodll_stringimpl.o: $(srcdir)/src/common/stringimpl.cpp $(MONODLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/stringimpl.cpp
|
||||
|
||||
monodll_stringops.o: $(srcdir)/src/common/stringops.cpp $(MONODLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/stringops.cpp
|
||||
|
||||
|
|
@ -19571,9 +19561,6 @@ monolib_stream.o: $(srcdir)/src/common/stream.cpp $(MONOLIB_ODEP)
|
|||
monolib_string.o: $(srcdir)/src/common/string.cpp $(MONOLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/string.cpp
|
||||
|
||||
monolib_stringimpl.o: $(srcdir)/src/common/stringimpl.cpp $(MONOLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/stringimpl.cpp
|
||||
|
||||
monolib_stringops.o: $(srcdir)/src/common/stringops.cpp $(MONOLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/stringops.cpp
|
||||
|
||||
|
|
@ -24338,9 +24325,6 @@ basedll_stream.o: $(srcdir)/src/common/stream.cpp $(BASEDLL_ODEP)
|
|||
basedll_string.o: $(srcdir)/src/common/string.cpp $(BASEDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/common/string.cpp
|
||||
|
||||
basedll_stringimpl.o: $(srcdir)/src/common/stringimpl.cpp $(BASEDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/common/stringimpl.cpp
|
||||
|
||||
basedll_stringops.o: $(srcdir)/src/common/stringops.cpp $(BASEDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(BASEDLL_CXXFLAGS) $(srcdir)/src/common/stringops.cpp
|
||||
|
||||
|
|
@ -24827,9 +24811,6 @@ baselib_stream.o: $(srcdir)/src/common/stream.cpp $(BASELIB_ODEP)
|
|||
baselib_string.o: $(srcdir)/src/common/string.cpp $(BASELIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/common/string.cpp
|
||||
|
||||
baselib_stringimpl.o: $(srcdir)/src/common/stringimpl.cpp $(BASELIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/common/stringimpl.cpp
|
||||
|
||||
baselib_stringops.o: $(srcdir)/src/common/stringops.cpp $(BASELIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(BASELIB_CXXFLAGS) $(srcdir)/src/common/stringops.cpp
|
||||
|
||||
|
|
|
|||
|
|
@ -547,7 +547,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
|||
src/common/strconv.cpp
|
||||
src/common/stream.cpp
|
||||
src/common/string.cpp
|
||||
src/common/stringimpl.cpp
|
||||
src/common/stringops.cpp
|
||||
src/common/strvararg.cpp
|
||||
src/common/sysopt.cpp
|
||||
|
|
@ -696,7 +695,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
|||
wx/strconv.h
|
||||
wx/stream.h
|
||||
wx/string.h
|
||||
wx/stringimpl.h
|
||||
wx/stringops.h
|
||||
wx/strvararg.h
|
||||
wx/sysopt.h
|
||||
|
|
|
|||
|
|
@ -460,7 +460,6 @@ set(BASE_CMN_SRC
|
|||
src/common/strconv.cpp
|
||||
src/common/stream.cpp
|
||||
src/common/string.cpp
|
||||
src/common/stringimpl.cpp
|
||||
src/common/stringops.cpp
|
||||
src/common/strvararg.cpp
|
||||
src/common/sysopt.cpp
|
||||
|
|
@ -611,7 +610,6 @@ set(BASE_CMN_HDR
|
|||
wx/strconv.h
|
||||
wx/stream.h
|
||||
wx/string.h
|
||||
wx/stringimpl.h
|
||||
wx/stringops.h
|
||||
wx/strvararg.h
|
||||
wx/sysopt.h
|
||||
|
|
|
|||
|
|
@ -187,7 +187,6 @@ if(NOT wxBUILD_DEBUG_LEVEL STREQUAL "Default")
|
|||
endif()
|
||||
|
||||
# Constants for setup.h creation
|
||||
set(wxUSE_STD_DEFAULT ON)
|
||||
if(NOT wxUSE_EXPAT)
|
||||
set(wxUSE_XRC OFF)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ mark_as_advanced(wxBUILD_PIC)
|
|||
wx_option(wxUSE_NO_RTTI "disable RTTI support" OFF)
|
||||
|
||||
# STL options
|
||||
wx_option(wxUSE_STD_IOSTREAM "use standard C++ streams" ON)
|
||||
wx_option(wxUSE_STL "use standard C++ classes for everything" OFF)
|
||||
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_STL "use C++ STL classes")
|
||||
wx_dependent_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" ON "wxUSE_STL" OFF)
|
||||
|
|
|
|||
|
|
@ -171,15 +171,9 @@
|
|||
|
||||
#cmakedefine01 wxUSE_STL
|
||||
|
||||
#cmakedefine01 wxUSE_STD_DEFAULT
|
||||
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
#cmakedefine01 wxUSE_STD_CONTAINERS
|
||||
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
#cmakedefine01 wxUSE_STD_IOSTREAM
|
||||
|
||||
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
|
||||
|
||||
|
|
|
|||
|
|
@ -479,7 +479,6 @@ BASE_CMN_SRC =
|
|||
src/common/strconv.cpp
|
||||
src/common/stream.cpp
|
||||
src/common/string.cpp
|
||||
src/common/stringimpl.cpp
|
||||
src/common/stringops.cpp
|
||||
src/common/strvararg.cpp
|
||||
src/common/sysopt.cpp
|
||||
|
|
@ -628,7 +627,6 @@ BASE_CMN_HDR =
|
|||
wx/strconv.h
|
||||
wx/stream.h
|
||||
wx/string.h
|
||||
wx/stringimpl.h
|
||||
wx/stringops.h
|
||||
wx/strvararg.h
|
||||
wx/sysopt.h
|
||||
|
|
|
|||
|
|
@ -460,7 +460,6 @@ MONODLL_OBJECTS = \
|
|||
$(OBJS)\monodll_strconv.o \
|
||||
$(OBJS)\monodll_stream.o \
|
||||
$(OBJS)\monodll_string.o \
|
||||
$(OBJS)\monodll_stringimpl.o \
|
||||
$(OBJS)\monodll_stringops.o \
|
||||
$(OBJS)\monodll_strvararg.o \
|
||||
$(OBJS)\monodll_sysopt.o \
|
||||
|
|
@ -620,7 +619,6 @@ MONOLIB_OBJECTS = \
|
|||
$(OBJS)\monolib_strconv.o \
|
||||
$(OBJS)\monolib_stream.o \
|
||||
$(OBJS)\monolib_string.o \
|
||||
$(OBJS)\monolib_stringimpl.o \
|
||||
$(OBJS)\monolib_stringops.o \
|
||||
$(OBJS)\monolib_strvararg.o \
|
||||
$(OBJS)\monolib_sysopt.o \
|
||||
|
|
@ -772,7 +770,6 @@ BASEDLL_OBJECTS = \
|
|||
$(OBJS)\basedll_strconv.o \
|
||||
$(OBJS)\basedll_stream.o \
|
||||
$(OBJS)\basedll_string.o \
|
||||
$(OBJS)\basedll_stringimpl.o \
|
||||
$(OBJS)\basedll_stringops.o \
|
||||
$(OBJS)\basedll_strvararg.o \
|
||||
$(OBJS)\basedll_sysopt.o \
|
||||
|
|
@ -905,7 +902,6 @@ BASELIB_OBJECTS = \
|
|||
$(OBJS)\baselib_strconv.o \
|
||||
$(OBJS)\baselib_stream.o \
|
||||
$(OBJS)\baselib_string.o \
|
||||
$(OBJS)\baselib_stringimpl.o \
|
||||
$(OBJS)\baselib_stringops.o \
|
||||
$(OBJS)\baselib_strvararg.o \
|
||||
$(OBJS)\baselib_sysopt.o \
|
||||
|
|
@ -7112,9 +7108,6 @@ $(OBJS)\monodll_stream.o: ../../src/common/stream.cpp
|
|||
$(OBJS)\monodll_string.o: ../../src/common/string.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\monodll_stringimpl.o: ../../src/common/stringimpl.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\monodll_stringops.o: ../../src/common/stringops.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
|
|
@ -9702,9 +9695,6 @@ $(OBJS)\monolib_stream.o: ../../src/common/stream.cpp
|
|||
$(OBJS)\monolib_string.o: ../../src/common/string.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\monolib_stringimpl.o: ../../src/common/stringimpl.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\monolib_stringops.o: ../../src/common/stringops.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
|
|
@ -12292,9 +12282,6 @@ $(OBJS)\basedll_stream.o: ../../src/common/stream.cpp
|
|||
$(OBJS)\basedll_string.o: ../../src/common/string.cpp
|
||||
$(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\basedll_stringimpl.o: ../../src/common/stringimpl.cpp
|
||||
$(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\basedll_stringops.o: ../../src/common/stringops.cpp
|
||||
$(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
|
|
@ -12643,9 +12630,6 @@ $(OBJS)\baselib_stream.o: ../../src/common/stream.cpp
|
|||
$(OBJS)\baselib_string.o: ../../src/common/string.cpp
|
||||
$(CXX) -c -o $@ $(BASELIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\baselib_stringimpl.o: ../../src/common/stringimpl.cpp
|
||||
$(CXX) -c -o $@ $(BASELIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\baselib_stringops.o: ../../src/common/stringops.cpp
|
||||
$(CXX) -c -o $@ $(BASELIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
|
|
|
|||
|
|
@ -490,7 +490,6 @@ MONODLL_OBJECTS = \
|
|||
$(OBJS)\monodll_strconv.obj \
|
||||
$(OBJS)\monodll_stream.obj \
|
||||
$(OBJS)\monodll_string.obj \
|
||||
$(OBJS)\monodll_stringimpl.obj \
|
||||
$(OBJS)\monodll_stringops.obj \
|
||||
$(OBJS)\monodll_strvararg.obj \
|
||||
$(OBJS)\monodll_sysopt.obj \
|
||||
|
|
@ -657,7 +656,6 @@ MONOLIB_OBJECTS = \
|
|||
$(OBJS)\monolib_strconv.obj \
|
||||
$(OBJS)\monolib_stream.obj \
|
||||
$(OBJS)\monolib_string.obj \
|
||||
$(OBJS)\monolib_stringimpl.obj \
|
||||
$(OBJS)\monolib_stringops.obj \
|
||||
$(OBJS)\monolib_strvararg.obj \
|
||||
$(OBJS)\monolib_sysopt.obj \
|
||||
|
|
@ -818,7 +816,6 @@ BASEDLL_OBJECTS = \
|
|||
$(OBJS)\basedll_strconv.obj \
|
||||
$(OBJS)\basedll_stream.obj \
|
||||
$(OBJS)\basedll_string.obj \
|
||||
$(OBJS)\basedll_stringimpl.obj \
|
||||
$(OBJS)\basedll_stringops.obj \
|
||||
$(OBJS)\basedll_strvararg.obj \
|
||||
$(OBJS)\basedll_sysopt.obj \
|
||||
|
|
@ -961,7 +958,6 @@ BASELIB_OBJECTS = \
|
|||
$(OBJS)\baselib_strconv.obj \
|
||||
$(OBJS)\baselib_stream.obj \
|
||||
$(OBJS)\baselib_string.obj \
|
||||
$(OBJS)\baselib_stringimpl.obj \
|
||||
$(OBJS)\baselib_stringops.obj \
|
||||
$(OBJS)\baselib_strvararg.obj \
|
||||
$(OBJS)\baselib_sysopt.obj \
|
||||
|
|
@ -7557,9 +7553,6 @@ $(OBJS)\monodll_stream.obj: ..\..\src\common\stream.cpp
|
|||
$(OBJS)\monodll_string.obj: ..\..\src\common\string.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\string.cpp
|
||||
|
||||
$(OBJS)\monodll_stringimpl.obj: ..\..\src\common\stringimpl.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\stringimpl.cpp
|
||||
|
||||
$(OBJS)\monodll_stringops.obj: ..\..\src\common\stringops.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\stringops.cpp
|
||||
|
||||
|
|
@ -10147,9 +10140,6 @@ $(OBJS)\monolib_stream.obj: ..\..\src\common\stream.cpp
|
|||
$(OBJS)\monolib_string.obj: ..\..\src\common\string.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\string.cpp
|
||||
|
||||
$(OBJS)\monolib_stringimpl.obj: ..\..\src\common\stringimpl.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\stringimpl.cpp
|
||||
|
||||
$(OBJS)\monolib_stringops.obj: ..\..\src\common\stringops.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\stringops.cpp
|
||||
|
||||
|
|
@ -12737,9 +12727,6 @@ $(OBJS)\basedll_stream.obj: ..\..\src\common\stream.cpp
|
|||
$(OBJS)\basedll_string.obj: ..\..\src\common\string.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) ..\..\src\common\string.cpp
|
||||
|
||||
$(OBJS)\basedll_stringimpl.obj: ..\..\src\common\stringimpl.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) ..\..\src\common\stringimpl.cpp
|
||||
|
||||
$(OBJS)\basedll_stringops.obj: ..\..\src\common\stringops.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) ..\..\src\common\stringops.cpp
|
||||
|
||||
|
|
@ -13088,9 +13075,6 @@ $(OBJS)\baselib_stream.obj: ..\..\src\common\stream.cpp
|
|||
$(OBJS)\baselib_string.obj: ..\..\src\common\string.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(BASELIB_CXXFLAGS) ..\..\src\common\string.cpp
|
||||
|
||||
$(OBJS)\baselib_stringimpl.obj: ..\..\src\common\stringimpl.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(BASELIB_CXXFLAGS) ..\..\src\common\stringimpl.cpp
|
||||
|
||||
$(OBJS)\baselib_stringops.obj: ..\..\src\common\stringops.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(BASELIB_CXXFLAGS) ..\..\src\common\stringops.cpp
|
||||
|
||||
|
|
|
|||
|
|
@ -535,7 +535,6 @@
|
|||
<ClCompile Include="..\..\src\common\strconv.cpp" />
|
||||
<ClCompile Include="..\..\src\common\stream.cpp" />
|
||||
<ClCompile Include="..\..\src\common\string.cpp" />
|
||||
<ClCompile Include="..\..\src\common\stringimpl.cpp" />
|
||||
<ClCompile Include="..\..\src\common\stringops.cpp" />
|
||||
<ClCompile Include="..\..\src\common\strvararg.cpp" />
|
||||
<ClCompile Include="..\..\src\common\sysopt.cpp" />
|
||||
|
|
@ -791,7 +790,6 @@
|
|||
<ClInclude Include="..\..\include\wx\strconv.h" />
|
||||
<ClInclude Include="..\..\include\wx\stream.h" />
|
||||
<ClInclude Include="..\..\include\wx\string.h" />
|
||||
<ClInclude Include="..\..\include\wx\stringimpl.h" />
|
||||
<ClInclude Include="..\..\include\wx\stringops.h" />
|
||||
<ClInclude Include="..\..\include\wx\strvararg.h" />
|
||||
<ClInclude Include="..\..\include\wx\sysopt.h" />
|
||||
|
|
|
|||
|
|
@ -219,9 +219,6 @@
|
|||
<ClCompile Include="..\..\src\common\string.cpp">
|
||||
<Filter>Common Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\stringimpl.cpp">
|
||||
<Filter>Common Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\stringops.cpp">
|
||||
<Filter>Common Sources</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -814,9 +811,6 @@
|
|||
<ClInclude Include="..\..\include\wx\string.h">
|
||||
<Filter>Common Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\wx\stringimpl.h">
|
||||
<Filter>Common Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\wx\stringops.h">
|
||||
<Filter>Common Headers</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -307,7 +307,6 @@
|
|||
28ADE8D385A53445A5451F23 /* jdhuff.c in Sources */ = {isa = PBXBuildFile; fileRef = 72869747E68E37998CB0A07E /* jdhuff.c */; };
|
||||
BD53E095EC1136EF853A47D9 /* m_layout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5EE0B8985443BDCB36F781F /* m_layout.cpp */; };
|
||||
4788F736CD9C324E8A3DFA74 /* LexEScript.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 58EFF24DE2E737CA8A164F5C /* LexEScript.cxx */; };
|
||||
55F0D287F60F3EDEA16CCB64 /* stringimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5357E76650035639844D15B /* stringimpl.cpp */; };
|
||||
EAE02BA934B43EEE92C496C8 /* dcpsg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EEA0945B20913754A54D0FD9 /* dcpsg.cpp */; };
|
||||
6AC347D2DCC730149A0A83D8 /* button_osx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF4F4F5211933057824B5621 /* button_osx.cpp */; };
|
||||
2EECB3C2F9523D0B95847A7F /* accel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C78A1539462370CAA429508 /* accel.cpp */; };
|
||||
|
|
@ -740,7 +739,6 @@
|
|||
784F7C50882F320FA76537B5 /* LexAU3.cxx in Sources */ = {isa = PBXBuildFile; fileRef = C76222F466E831F896A89269 /* LexAU3.cxx */; };
|
||||
BF068F3C06473D8CBC55D508 /* PositionCache.cxx in Sources */ = {isa = PBXBuildFile; fileRef = BCD873D873A53BBF955D8A4E /* PositionCache.cxx */; };
|
||||
700BBDECBE313E108BA99ABD /* toplvcmn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 861438BD294335D4B859EA71 /* toplvcmn.cpp */; };
|
||||
55F0D287F60F3EDEA16CCB65 /* stringimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5357E76650035639844D15B /* stringimpl.cpp */; };
|
||||
20BEEFFA08F3396791596871 /* dlunix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CA2D9F325F833C408657E7B7 /* dlunix.cpp */; };
|
||||
1E17F95DD433379E8C18298C /* odcombo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7906BD74118A3B4DAC515BC2 /* odcombo.cpp */; };
|
||||
97C551F8AEF133D680D1FD36 /* LexProgress.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E4A9905843A4683A6B460 /* LexProgress.cxx */; };
|
||||
|
|
@ -2272,7 +2270,6 @@
|
|||
05814571E7A83F5DBFB6E4C7 /* msgout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E968913A9A593B258BD8EACB /* msgout.cpp */; };
|
||||
DC6B669C9A78398F914AEE55 /* fontutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5FF661188B563D27A11F5716 /* fontutil.cpp */; };
|
||||
6D723C987BFB39B7B887DCB3 /* Editor.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DA5E95D498C53A808A8E2EEB /* Editor.cxx */; };
|
||||
55F0D287F60F3EDEA16CCB66 /* stringimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5357E76650035639844D15B /* stringimpl.cpp */; };
|
||||
438EAEA4B30C325C827F6199 /* xh_fontpicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 87E609641B583666AB9D1D58 /* xh_fontpicker.cpp */; };
|
||||
0164A65CDB7A334A8E9AA4C1 /* dynload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93BA27DFFB023F2EBD6295E3 /* dynload.cpp */; };
|
||||
86003C8EB906304F9025F78A /* jcinit.c in Sources */ = {isa = PBXBuildFile; fileRef = AA6C6739C3BD3EFA9CF71102 /* jcinit.c */; };
|
||||
|
|
@ -4167,7 +4164,6 @@
|
|||
080597FC0436378E96EDA94B /* m_links.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = m_links.cpp; path = ../../src/html/m_links.cpp; sourceTree = SOURCE_ROOT; };
|
||||
726C0457DF1232C793918DC1 /* tif_zip.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = tif_zip.c; path = ../../src/tiff/libtiff/tif_zip.c; sourceTree = SOURCE_ROOT; };
|
||||
C3904351139F3F0DB4B72F94 /* pcre2_auto_possess.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = pcre2_auto_possess.c; path = ../../3rdparty/pcre/src/pcre2_auto_possess.c; sourceTree = SOURCE_ROOT; };
|
||||
E5357E76650035639844D15B /* stringimpl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = stringimpl.cpp; path = ../../src/common/stringimpl.cpp; sourceTree = SOURCE_ROOT; };
|
||||
B60497805D37375EBFCF3D98 /* pcre2_tables.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = pcre2_tables.c; path = ../../3rdparty/pcre/src/pcre2_tables.c; sourceTree = SOURCE_ROOT; };
|
||||
FC6A8FAE9CA63EEB8883B6BD /* pcre2_config.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = pcre2_config.c; path = ../../3rdparty/pcre/src/pcre2_config.c; sourceTree = SOURCE_ROOT; };
|
||||
A0DCC5EF59143640BE13AD73 /* jidctfst.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = jidctfst.c; path = ../../src/jpeg/jidctfst.c; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -6370,7 +6366,6 @@
|
|||
9FEB8204E530329FA085E5B8 /* strconv.cpp */,
|
||||
FFDD414DBCC73D0FB6C2C5FD /* stream.cpp */,
|
||||
F7E99B35A98D30818120B002 /* string.cpp */,
|
||||
E5357E76650035639844D15B /* stringimpl.cpp */,
|
||||
F1E724EA70AB35DDB130F84F /* stringops.cpp */,
|
||||
0EEAD9C3E180305D8899441E /* strvararg.cpp */,
|
||||
F32F6B47EBB23068B1FCDC0D /* sysopt.cpp */,
|
||||
|
|
@ -7702,7 +7697,6 @@
|
|||
E882402BEE0330A080A65171 /* strconv.cpp in Sources */,
|
||||
30493B486DFF35AF80D12C49 /* stream.cpp in Sources */,
|
||||
795613831EC8332A83FF26E8 /* string.cpp in Sources */,
|
||||
55F0D287F60F3EDEA16CCB64 /* stringimpl.cpp in Sources */,
|
||||
88E1AE56FD393C8BA5CF8546 /* stringops.cpp in Sources */,
|
||||
056E30EA43753A7CB1AF8C9F /* strvararg.cpp in Sources */,
|
||||
4DD98A9436C83CF3B9425A78 /* sysopt.cpp in Sources */,
|
||||
|
|
@ -8426,7 +8420,6 @@
|
|||
E882402BEE0330A080A6516F /* strconv.cpp in Sources */,
|
||||
30493B486DFF35AF80D12C4B /* stream.cpp in Sources */,
|
||||
795613831EC8332A83FF26E9 /* string.cpp in Sources */,
|
||||
55F0D287F60F3EDEA16CCB66 /* stringimpl.cpp in Sources */,
|
||||
88E1AE56FD393C8BA5CF8545 /* stringops.cpp in Sources */,
|
||||
056E30EA43753A7CB1AF8C9E /* strvararg.cpp in Sources */,
|
||||
4DD98A9436C83CF3B9425A7A /* sysopt.cpp in Sources */,
|
||||
|
|
@ -9750,7 +9743,6 @@
|
|||
E882402BEE0330A080A65170 /* strconv.cpp in Sources */,
|
||||
30493B486DFF35AF80D12C4A /* stream.cpp in Sources */,
|
||||
795613831EC8332A83FF26E7 /* string.cpp in Sources */,
|
||||
55F0D287F60F3EDEA16CCB65 /* stringimpl.cpp in Sources */,
|
||||
88E1AE56FD393C8BA5CF8547 /* stringops.cpp in Sources */,
|
||||
056E30EA43753A7CB1AF8CA0 /* strvararg.cpp in Sources */,
|
||||
4DD98A9436C83CF3B9425A79 /* sysopt.cpp in Sources */,
|
||||
|
|
|
|||
|
|
@ -457,7 +457,6 @@
|
|||
0D6596A44A8C37DE85D578F6 /* Document.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 71DB140E670738839EC42C2B /* Document.cxx */; };
|
||||
353B584AD0C03919A57A3048 /* affinematrix2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD09A813E10A31C19554B425 /* affinematrix2d.cpp */; };
|
||||
EA10DA3199813E90B39C70D3 /* xh_infobar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45C65E309F3A39598C043657 /* xh_infobar.cpp */; };
|
||||
55F0D287F60F3EDEA16CCB64 /* stringimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5357E76650035639844D15B /* stringimpl.cpp */; };
|
||||
056CA84179433AA48D55DA65 /* bar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FDDE855D9F83E4891362EB4 /* bar.cpp */; };
|
||||
E3AD8574E13B39BDB8D4E92E /* LexKVIrc.cxx in Sources */ = {isa = PBXBuildFile; fileRef = FCE8B55EBD6B348B8351AB08 /* LexKVIrc.cxx */; };
|
||||
90BC965B1A1F35A3B2C9D1C9 /* Decoration.cxx in Sources */ = {isa = PBXBuildFile; fileRef = BF1C44D726E63B18A98006EC /* Decoration.cxx */; };
|
||||
|
|
@ -1350,7 +1349,6 @@
|
|||
7A1CE0B28CB73F90AE92B5AB /* richtooltipcmn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = richtooltipcmn.cpp; path = ../../src/common/richtooltipcmn.cpp; sourceTree = SOURCE_ROOT; };
|
||||
93BA27DFFB023F2EBD6295E3 /* dynload.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = dynload.cpp; path = ../../src/common/dynload.cpp; sourceTree = SOURCE_ROOT; };
|
||||
B4028ABB08C63AB59F5F240B /* m_list.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = m_list.cpp; path = ../../src/html/m_list.cpp; sourceTree = SOURCE_ROOT; };
|
||||
E5357E76650035639844D15B /* stringimpl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = stringimpl.cpp; path = ../../src/common/stringimpl.cpp; sourceTree = SOURCE_ROOT; };
|
||||
497861EB7E623C68951D1AB2 /* LexAPDL.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LexAPDL.cxx; path = ../../src/stc/scintilla/lexers/LexAPDL.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DDE22D7DDAC93DCABAE5AED0 /* socketiohandler.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = socketiohandler.cpp; path = ../../src/common/socketiohandler.cpp; sourceTree = SOURCE_ROOT; };
|
||||
DE16011AD6323AAC8616F973 /* stdstream.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = stdstream.cpp; path = ../../src/common/stdstream.cpp; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -2158,7 +2156,6 @@
|
|||
9FEB8204E530329FA085E5B8 /* strconv.cpp */,
|
||||
FFDD414DBCC73D0FB6C2C5FD /* stream.cpp */,
|
||||
F7E99B35A98D30818120B002 /* string.cpp */,
|
||||
E5357E76650035639844D15B /* stringimpl.cpp */,
|
||||
F1E724EA70AB35DDB130F84F /* stringops.cpp */,
|
||||
0EEAD9C3E180305D8899441E /* strvararg.cpp */,
|
||||
F32F6B47EBB23068B1FCDC0D /* sysopt.cpp */,
|
||||
|
|
@ -3095,7 +3092,6 @@
|
|||
E882402BEE0330A080A6516F /* strconv.cpp in Sources */,
|
||||
30493B486DFF35AF80D12C49 /* stream.cpp in Sources */,
|
||||
795613831EC8332A83FF26E7 /* string.cpp in Sources */,
|
||||
55F0D287F60F3EDEA16CCB64 /* stringimpl.cpp in Sources */,
|
||||
88E1AE56FD393C8BA5CF8545 /* stringops.cpp in Sources */,
|
||||
056E30EA43753A7CB1AF8C9E /* strvararg.cpp in Sources */,
|
||||
4DD98A9436C83CF3B9425A78 /* sysopt.cpp in Sources */,
|
||||
|
|
|
|||
84
configure
vendored
84
configure
vendored
|
|
@ -1122,9 +1122,7 @@ enable_cxx11
|
|||
with_cxx
|
||||
enable_stl
|
||||
enable_std_containers
|
||||
enable_std_containers_compat
|
||||
enable_std_iostreams
|
||||
enable_std_string
|
||||
enable_std_string_conv_in_wxstring
|
||||
enable_unsafe_conv_in_wxstring
|
||||
enable_utf8
|
||||
|
|
@ -2090,9 +2088,7 @@ Optional Features:
|
|||
--enable-cxx11 obsolete option doing nothing
|
||||
--enable-stl use standard C++ classes for everything
|
||||
--enable-std_containers use standard C++ container classes
|
||||
--enable-std_containers_compat use standard C++ container classes when it can be done compatible
|
||||
--enable-std_iostreams use standard C++ stream classes
|
||||
--enable-std_string use standard C++ string classes
|
||||
--disable-std_iostreams disable use of standard C++ stream classes
|
||||
--enable-std_string_conv_in_wxstring provide implicit conversion to std::string in wxString
|
||||
--disable-unsafe_conv_in_wxstring disable unsafe implicit conversions in wxString
|
||||
--enable-utf8 use UTF-8 representation for strings (Unix only)
|
||||
|
|
@ -3849,8 +3845,6 @@ SAMPLES_RPATH_FLAG=
|
|||
DYLIB_RPATH_INSTALL=
|
||||
DYLIB_RPATH_POSTLINK=
|
||||
|
||||
DEFAULT_STD_FLAG=yes
|
||||
|
||||
case "${host}" in
|
||||
*-hp-hpux* )
|
||||
USE_HPUX=1
|
||||
|
|
@ -4045,9 +4039,6 @@ esac
|
|||
DEFAULT_wxUSE_ALL_FEATURES=yes
|
||||
|
||||
DEFAULT_wxUSE_STD_CONTAINERS=no
|
||||
DEFAULT_wxUSE_STD_CONTAINERS_COMPATIBLY=$DEFAULT_STD_FLAG
|
||||
DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
|
||||
DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
|
||||
|
||||
DEFAULT_wxUSE_DMALLOC=no
|
||||
DEFAULT_wxUSE_LIBCURL=auto
|
||||
|
|
@ -5662,9 +5653,6 @@ fi
|
|||
|
||||
if test "$wxUSE_STL" = "yes"; then
|
||||
DEFAULT_wxUSE_STD_CONTAINERS=yes
|
||||
DEFAULT_wxUSE_STD_CONTAINERS_COMPATIBLY=yes
|
||||
DEFAULT_wxUSE_STD_IOSTREAM=yes
|
||||
DEFAULT_wxUSE_STD_STRING=yes
|
||||
fi
|
||||
|
||||
enablestring=
|
||||
|
|
@ -5696,36 +5684,7 @@ fi
|
|||
eval "$wx_cv_use_std_containers"
|
||||
|
||||
|
||||
enablestring=
|
||||
defaultval=
|
||||
if test -z "$defaultval"; then
|
||||
if test x"$enablestring" = xdisable; then
|
||||
defaultval=yes
|
||||
else
|
||||
defaultval=no
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --enable-std_containers_compat was given.
|
||||
if test "${enable_std_containers_compat+set}" = set; then :
|
||||
enableval=$enable_std_containers_compat;
|
||||
if test "$enableval" = yes; then
|
||||
wx_cv_use_std_containers_compat='wxUSE_STD_CONTAINERS_COMPATIBLY=yes'
|
||||
else
|
||||
wx_cv_use_std_containers_compat='wxUSE_STD_CONTAINERS_COMPATIBLY=no'
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
wx_cv_use_std_containers_compat='wxUSE_STD_CONTAINERS_COMPATIBLY=${'DEFAULT_wxUSE_STD_CONTAINERS_COMPATIBLY":-$defaultval}"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
eval "$wx_cv_use_std_containers_compat"
|
||||
|
||||
|
||||
enablestring=
|
||||
enablestring=disable
|
||||
defaultval=
|
||||
if test -z "$defaultval"; then
|
||||
if test x"$enablestring" = xdisable; then
|
||||
|
|
@ -5754,35 +5713,6 @@ fi
|
|||
eval "$wx_cv_use_std_iostreams"
|
||||
|
||||
|
||||
enablestring=
|
||||
defaultval=
|
||||
if test -z "$defaultval"; then
|
||||
if test x"$enablestring" = xdisable; then
|
||||
defaultval=yes
|
||||
else
|
||||
defaultval=no
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --enable-std_string was given.
|
||||
if test "${enable_std_string+set}" = set; then :
|
||||
enableval=$enable_std_string;
|
||||
if test "$enableval" = yes; then
|
||||
wx_cv_use_std_string='wxUSE_STD_STRING=yes'
|
||||
else
|
||||
wx_cv_use_std_string='wxUSE_STD_STRING=no'
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
wx_cv_use_std_string='wxUSE_STD_STRING=${'DEFAULT_wxUSE_STD_STRING":-$defaultval}"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
eval "$wx_cv_use_std_string"
|
||||
|
||||
|
||||
enablestring=
|
||||
defaultval=
|
||||
if test -z "$defaultval"; then
|
||||
|
|
@ -37599,21 +37529,11 @@ if test "$wxUSE_STD_CONTAINERS" = "yes"; then
|
|||
|
||||
fi
|
||||
|
||||
if test "$wxUSE_STD_CONTAINERS_COMPATIBLY" = "yes"; then
|
||||
$as_echo "#define wxUSE_STD_CONTAINERS_COMPATIBLY 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
if test "$wxUSE_STD_IOSTREAM" = "yes"; then
|
||||
$as_echo "#define wxUSE_STD_IOSTREAM 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
if test "$wxUSE_STD_STRING" = "yes"; then
|
||||
$as_echo "#define wxUSE_STD_STRING 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
if test "$wxUSE_STD_STRING_CONV_IN_WXSTRING" = "yes"; then
|
||||
$as_echo "#define wxUSE_STD_STRING_CONV_IN_WXSTRING 1" >>confdefs.h
|
||||
|
||||
|
|
|
|||
20
configure.in
20
configure.in
|
|
@ -140,8 +140,6 @@ SAMPLES_RPATH_FLAG=
|
|||
DYLIB_RPATH_INSTALL=
|
||||
DYLIB_RPATH_POSTLINK=
|
||||
|
||||
DEFAULT_STD_FLAG=yes
|
||||
|
||||
dnl to support a new system, you need to add its canonical name (as determined
|
||||
dnl by config.sub or specified by the configure command line) to this "case"
|
||||
dnl and also define the shared library flags below - search for
|
||||
|
|
@ -327,9 +325,6 @@ dnl default)
|
|||
DEFAULT_wxUSE_ALL_FEATURES=yes
|
||||
|
||||
DEFAULT_wxUSE_STD_CONTAINERS=no
|
||||
DEFAULT_wxUSE_STD_CONTAINERS_COMPATIBLY=$DEFAULT_STD_FLAG
|
||||
DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
|
||||
DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
|
||||
|
||||
dnl libraries disabled by default or requiring some special handling
|
||||
DEFAULT_wxUSE_DMALLOC=no
|
||||
|
|
@ -665,14 +660,9 @@ AC_ARG_WITH(cxx, [ --with-cxx=11|14|17|20 use the given C++ dialect]
|
|||
WX_ARG_ENABLE(stl, [ --enable-stl use standard C++ classes for everything], wxUSE_STL)
|
||||
if test "$wxUSE_STL" = "yes"; then
|
||||
DEFAULT_wxUSE_STD_CONTAINERS=yes
|
||||
DEFAULT_wxUSE_STD_CONTAINERS_COMPATIBLY=yes
|
||||
DEFAULT_wxUSE_STD_IOSTREAM=yes
|
||||
DEFAULT_wxUSE_STD_STRING=yes
|
||||
fi
|
||||
WX_ARG_ENABLE(std_containers,[ --enable-std_containers use standard C++ container classes], wxUSE_STD_CONTAINERS)
|
||||
WX_ARG_ENABLE(std_containers_compat, [ --enable-std_containers_compat use standard C++ container classes when it can be done compatible], wxUSE_STD_CONTAINERS_COMPATIBLY)
|
||||
WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
|
||||
WX_ARG_ENABLE(std_string, [ --enable-std_string use standard C++ string classes], wxUSE_STD_STRING)
|
||||
WX_ARG_DISABLE(std_iostreams,[ --disable-std_iostreams disable use of standard C++ stream classes], wxUSE_STD_IOSTREAM)
|
||||
WX_ARG_ENABLE(std_string_conv_in_wxstring, [ --enable-std_string_conv_in_wxstring provide implicit conversion to std::string in wxString], wxUSE_STD_STRING_CONV_IN_WXSTRING)
|
||||
WX_ARG_DISABLE(unsafe_conv_in_wxstring, [ --disable-unsafe_conv_in_wxstring disable unsafe implicit conversions in wxString], wxUSE_UNSAFE_WXSTRING_CONV)
|
||||
WX_ARG_ENABLE_PARAM(utf8, [ --enable-utf8 use UTF-8 representation for strings (Unix only)], wxUSE_UNICODE_UTF8)
|
||||
|
|
@ -5430,18 +5420,10 @@ if test "$wxUSE_STD_CONTAINERS" = "yes"; then
|
|||
AC_DEFINE(wxUSE_STD_CONTAINERS)
|
||||
fi
|
||||
|
||||
if test "$wxUSE_STD_CONTAINERS_COMPATIBLY" = "yes"; then
|
||||
AC_DEFINE(wxUSE_STD_CONTAINERS_COMPATIBLY)
|
||||
fi
|
||||
|
||||
if test "$wxUSE_STD_IOSTREAM" = "yes"; then
|
||||
AC_DEFINE(wxUSE_STD_IOSTREAM)
|
||||
fi
|
||||
|
||||
if test "$wxUSE_STD_STRING" = "yes"; then
|
||||
AC_DEFINE(wxUSE_STD_STRING)
|
||||
fi
|
||||
|
||||
if test "$wxUSE_STD_STRING_CONV_IN_WXSTRING" = "yes"; then
|
||||
AC_DEFINE(wxUSE_STD_STRING_CONV_IN_WXSTRING)
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -29,11 +29,6 @@ library:
|
|||
@beginDefList
|
||||
@itemdef{wxUSE_STL, Container classes and wxString are implemented using
|
||||
standard classes and provide the same standard API.}
|
||||
@itemdef{wxUSE_STD_STRING, wxString is implemented using std::[w]string and can
|
||||
be constructed from it (but provides wxWidgets-compatible API, in
|
||||
particular is implicitly convertible to @c char* and not std::[w]string).}
|
||||
@itemdef{wxUSE_STD_IOSTREAM, Standard C++ classes are used instead of or in
|
||||
addition to wx stream classes.}
|
||||
@itemdef{wxUSE_UNICODE, Always defined as 1 in wxWidgets 3.3 and later, only
|
||||
exists for compatibility.}
|
||||
@itemdef{wxUSE_UNICODE_WCHAR, wxString uses wchar_t buffer for internal storage
|
||||
|
|
|
|||
|
|
@ -283,35 +283,11 @@
|
|||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 as the options below already provide a relatively
|
||||
// good level of interoperability and changing this option arguably isn't worth
|
||||
// diverging from the official builds of the library.
|
||||
// Recommended setting: 1 for new code bases and if compatibility with the
|
||||
// official build of the library is not important, 0 otherwise.
|
||||
#define wxUSE_STL 0
|
||||
|
||||
// This is not a real option but is used as the default value for
|
||||
// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY.
|
||||
//
|
||||
// Set it to 0 if you want to disable the use of all standard classes
|
||||
// completely for some reason.
|
||||
#define wxUSE_STD_DEFAULT 1
|
||||
|
||||
// Use standard C++ containers where it can be done without breaking backwards
|
||||
// compatibility.
|
||||
//
|
||||
// This provides better interoperability with the standard library, e.g. with
|
||||
// this option on it's possible to insert std::vector<> into many wxWidgets
|
||||
// containers directly.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting is 1 unless you want to avoid all dependencies on the
|
||||
// standard library.
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
|
||||
// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
|
||||
// usually more limited) implementations are used which allows to avoid the
|
||||
// dependency on the C++ run-time library.
|
||||
// Use standard C++ containers to implement all wx container classes.
|
||||
//
|
||||
// Default is 0 for compatibility reasons.
|
||||
//
|
||||
|
|
@ -320,30 +296,15 @@
|
|||
#define wxUSE_STD_CONTAINERS 0
|
||||
|
||||
// Use standard C++ streams if 1 instead of wx streams in some places. If
|
||||
// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
|
||||
// standard streams library.
|
||||
// disabled, wx streams are used instead.
|
||||
//
|
||||
// Notice that enabling this does not replace wx streams with std streams
|
||||
// everywhere, in a lot of places wx streams are used no matter what.
|
||||
//
|
||||
// Default is 1 if compiler supports it.
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting: 1 if you use the standard streams anyhow and so
|
||||
// dependency on the standard streams library is not a
|
||||
// problem
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
// Enable minimal interoperability with the standard C++ string class if 1.
|
||||
// "Minimal" means that wxString can be constructed from std::string or
|
||||
// std::wstring but can't be implicitly converted to them. You need to enable
|
||||
// the option below for the latter.
|
||||
//
|
||||
// Default is 1 for most compilers.
|
||||
//
|
||||
// Recommended setting: 1 unless you want to ensure your program doesn't use
|
||||
// the standard C++ library at all.
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
|
||||
// Recommended setting: 1.
|
||||
#define wxUSE_STD_IOSTREAM 1
|
||||
// Make wxString as much interchangeable with std::[w]string as possible, in
|
||||
// particular allow implicit conversion of wxString to either of these classes.
|
||||
// This comes at a price (or a benefit, depending on your point of view) of not
|
||||
|
|
@ -353,6 +314,10 @@
|
|||
// disabled by default but can be enabled for your build if you don't care
|
||||
// about compatibility.
|
||||
//
|
||||
// Note that wxString can always be constructed from std::[w]string, whether
|
||||
// this option is turned on or off, it only enables implicit conversion in the
|
||||
// other direction.
|
||||
//
|
||||
// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
|
||||
//
|
||||
// Recommended setting: 0 to remain compatible with the official builds of
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@
|
|||
#include "wx/string.h"
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
#include <vector>
|
||||
#endif
|
||||
#include <vector>
|
||||
|
||||
// these functions are only used in STL build now but we define them in any
|
||||
// case for compatibility with the existing code outside of the library which
|
||||
|
|
@ -508,14 +506,12 @@ public:
|
|||
m_data.ptr = strings;
|
||||
}
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
// construct an adapter from a vector of strings
|
||||
wxArrayStringsAdapter(const std::vector<wxString>& strings)
|
||||
: m_type(wxSTRING_POINTER), m_size(strings.size())
|
||||
{
|
||||
m_data.ptr = m_size == 0 ? nullptr : &strings[0];
|
||||
}
|
||||
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
|
||||
// construct an adapter from a single wxString
|
||||
wxArrayStringsAdapter(const wxString& s)
|
||||
|
|
|
|||
|
|
@ -314,14 +314,6 @@
|
|||
# endif
|
||||
#endif /* !defined(wxUSE_STD_CONTAINERS) */
|
||||
|
||||
#ifndef wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_STD_CONTAINERS_COMPATIBLY must be defined, please read comment near the top of this file."
|
||||
# else
|
||||
# define wxUSE_STD_CONTAINERS_COMPATIBLY 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_STD_CONTAINERS_COMPATIBLY) */
|
||||
|
||||
#ifndef wxUSE_STD_STRING_CONV_IN_WXSTRING
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_STD_STRING_CONV_IN_WXSTRING must be defined, please read comment near the top of this file."
|
||||
|
|
@ -2053,15 +2045,6 @@
|
|||
# endif
|
||||
# endif
|
||||
|
||||
# if !wxUSE_STREAMS && !wxUSE_STD_IOSTREAM
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "DocView requires wxUSE_STREAMS or wxUSE_STD_IOSTREAM"
|
||||
# else
|
||||
# undef wxUSE_STREAMS
|
||||
# define wxUSE_STREAMS 1
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if !wxUSE_FILE_HISTORY
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "DocView requires wxUSE_FILE_HISTORY"
|
||||
|
|
|
|||
|
|
@ -134,12 +134,7 @@ public:
|
|||
typedef wxCmdLineArg value_type;
|
||||
typedef const wxCmdLineArg* pointer;
|
||||
typedef const wxCmdLineArg& reference;
|
||||
|
||||
// We avoid dependency on standard library by default but if we do use
|
||||
// std::string, then it's ok to use iterator tags as well.
|
||||
#if wxUSE_STD_STRING
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
#endif // wx_USE_STD_STRING
|
||||
|
||||
const_iterator() : m_parser(nullptr), m_index(0) {}
|
||||
reference operator *() const;
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@
|
|||
#include "wx/arrstr.h"
|
||||
#include "wx/control.h" // base class
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
#include <vector>
|
||||
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxItemContainer defines an interface which is implemented by all controls
|
||||
|
|
@ -219,11 +217,8 @@ public:
|
|||
const wxString *items,
|
||||
wxClientData **clientData)
|
||||
{ return AppendItems(wxArrayStringsAdapter(n, items), clientData); }
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
int Append(const std::vector<wxString>& items)
|
||||
{ return AppendItems(items); }
|
||||
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
|
||||
// only for RTTI needs (separate name)
|
||||
void AppendString(const wxString& item)
|
||||
|
|
@ -263,11 +258,8 @@ public:
|
|||
unsigned int pos,
|
||||
wxClientData **clientData)
|
||||
{ return InsertItems(wxArrayStringsAdapter(n, items), pos, clientData); }
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
int Insert(const std::vector<wxString>& items, unsigned int pos)
|
||||
{ return InsertItems(items, pos); }
|
||||
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
|
||||
// replacing items
|
||||
// ---------------
|
||||
|
|
@ -284,11 +276,8 @@ public:
|
|||
{ Clear(); Append(n, items, clientData); }
|
||||
void Set(unsigned int n, const wxString *items, wxClientData **clientData)
|
||||
{ Clear(); Append(n, items, clientData); }
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
void Set(const std::vector<wxString>& items)
|
||||
{ Clear(); Append(items); }
|
||||
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
|
||||
// deleting items
|
||||
// --------------
|
||||
|
|
|
|||
|
|
@ -2602,17 +2602,15 @@ typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
|
|||
#endif
|
||||
|
||||
#if defined(__CYGWIN__) && defined(__WXMSW__)
|
||||
# if wxUSE_STD_CONTAINERS || defined(wxUSE_STD_STRING)
|
||||
/*
|
||||
NASTY HACK because the gethostname in sys/unistd.h which the gnu
|
||||
stl includes and wx builds with by default clash with each other
|
||||
(windows version 2nd param is int, sys/unistd.h version is unsigned
|
||||
int).
|
||||
*/
|
||||
# define gethostname gethostnameHACK
|
||||
# include <unistd.h>
|
||||
# undef gethostname
|
||||
# endif
|
||||
/*
|
||||
NASTY HACK because the gethostname in sys/unistd.h which the gnu
|
||||
stl includes and wx builds with by default clash with each other
|
||||
(windows version 2nd param is int, sys/unistd.h version is unsigned
|
||||
int).
|
||||
*/
|
||||
# define gethostname gethostnameHACK
|
||||
# include <unistd.h>
|
||||
# undef gethostname
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@
|
|||
|
||||
#include "wx/scrolwin.h"
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
#include <iterator>
|
||||
#endif
|
||||
#include <iterator>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
|
|
@ -1129,9 +1127,7 @@ public:
|
|||
class iterator
|
||||
{
|
||||
public:
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
#endif
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef wxGridBlockCoords value_type;
|
||||
typedef const value_type& reference;
|
||||
|
|
|
|||
|
|
@ -284,35 +284,11 @@
|
|||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 as the options below already provide a relatively
|
||||
// good level of interoperability and changing this option arguably isn't worth
|
||||
// diverging from the official builds of the library.
|
||||
// Recommended setting: 1 for new code bases and if compatibility with the
|
||||
// official build of the library is not important, 0 otherwise.
|
||||
#define wxUSE_STL 0
|
||||
|
||||
// This is not a real option but is used as the default value for
|
||||
// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY.
|
||||
//
|
||||
// Set it to 0 if you want to disable the use of all standard classes
|
||||
// completely for some reason.
|
||||
#define wxUSE_STD_DEFAULT 1
|
||||
|
||||
// Use standard C++ containers where it can be done without breaking backwards
|
||||
// compatibility.
|
||||
//
|
||||
// This provides better interoperability with the standard library, e.g. with
|
||||
// this option on it's possible to insert std::vector<> into many wxWidgets
|
||||
// containers directly.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting is 1 unless you want to avoid all dependencies on the
|
||||
// standard library.
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
|
||||
// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
|
||||
// usually more limited) implementations are used which allows to avoid the
|
||||
// dependency on the C++ run-time library.
|
||||
// Use standard C++ containers to implement all wx container classes.
|
||||
//
|
||||
// Default is 0 for compatibility reasons.
|
||||
//
|
||||
|
|
@ -321,30 +297,15 @@
|
|||
#define wxUSE_STD_CONTAINERS 0
|
||||
|
||||
// Use standard C++ streams if 1 instead of wx streams in some places. If
|
||||
// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
|
||||
// standard streams library.
|
||||
// disabled, wx streams are used instead.
|
||||
//
|
||||
// Notice that enabling this does not replace wx streams with std streams
|
||||
// everywhere, in a lot of places wx streams are used no matter what.
|
||||
//
|
||||
// Default is 1 if compiler supports it.
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting: 1 if you use the standard streams anyhow and so
|
||||
// dependency on the standard streams library is not a
|
||||
// problem
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
// Enable minimal interoperability with the standard C++ string class if 1.
|
||||
// "Minimal" means that wxString can be constructed from std::string or
|
||||
// std::wstring but can't be implicitly converted to them. You need to enable
|
||||
// the option below for the latter.
|
||||
//
|
||||
// Default is 1 for most compilers.
|
||||
//
|
||||
// Recommended setting: 1 unless you want to ensure your program doesn't use
|
||||
// the standard C++ library at all.
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
|
||||
// Recommended setting: 1.
|
||||
#define wxUSE_STD_IOSTREAM 1
|
||||
// Make wxString as much interchangeable with std::[w]string as possible, in
|
||||
// particular allow implicit conversion of wxString to either of these classes.
|
||||
// This comes at a price (or a benefit, depending on your point of view) of not
|
||||
|
|
@ -354,6 +315,10 @@
|
|||
// disabled by default but can be enabled for your build if you don't care
|
||||
// about compatibility.
|
||||
//
|
||||
// Note that wxString can always be constructed from std::[w]string, whether
|
||||
// this option is turned on or off, it only enables implicit conversion in the
|
||||
// other direction.
|
||||
//
|
||||
// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
|
||||
//
|
||||
// Recommended setting: 0 to remain compatible with the official builds of
|
||||
|
|
|
|||
|
|
@ -596,15 +596,11 @@ private:
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Helper macro defining common iterator typedefs
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
#include <iterator>
|
||||
#include <iterator>
|
||||
|
||||
#define WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \
|
||||
typedef std::ptrdiff_t difference_type; \
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
#else
|
||||
#define WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY()
|
||||
#endif
|
||||
#define WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \
|
||||
typedef std::ptrdiff_t difference_type; \
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
|
||||
// and now some heavy magic...
|
||||
|
||||
|
|
|
|||
|
|
@ -31,14 +31,4 @@ struct wxIsMovable
|
|||
static const bool value = true; \
|
||||
};
|
||||
|
||||
// Our implementation of wxString is written in such way that it's safe to move
|
||||
// it around (unless position cache is used which unfortunately breaks this).
|
||||
// OTOH, we don't know anything about std::string.
|
||||
// (NB: we don't put this into string.h and choose to include wx/string.h from
|
||||
// here instead so that rarely-used wxIsMovable<T> code isn't included by
|
||||
// everything)
|
||||
#if !wxUSE_STD_STRING && !wxUSE_STRING_POS_CACHE
|
||||
WX_DECLARE_TYPE_MOVABLE(wxString)
|
||||
#endif
|
||||
|
||||
#endif // _WX_META_MOVABLE_H_
|
||||
|
|
|
|||
|
|
@ -284,35 +284,11 @@
|
|||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 as the options below already provide a relatively
|
||||
// good level of interoperability and changing this option arguably isn't worth
|
||||
// diverging from the official builds of the library.
|
||||
// Recommended setting: 1 for new code bases and if compatibility with the
|
||||
// official build of the library is not important, 0 otherwise.
|
||||
#define wxUSE_STL 0
|
||||
|
||||
// This is not a real option but is used as the default value for
|
||||
// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY.
|
||||
//
|
||||
// Set it to 0 if you want to disable the use of all standard classes
|
||||
// completely for some reason.
|
||||
#define wxUSE_STD_DEFAULT 1
|
||||
|
||||
// Use standard C++ containers where it can be done without breaking backwards
|
||||
// compatibility.
|
||||
//
|
||||
// This provides better interoperability with the standard library, e.g. with
|
||||
// this option on it's possible to insert std::vector<> into many wxWidgets
|
||||
// containers directly.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting is 1 unless you want to avoid all dependencies on the
|
||||
// standard library.
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
|
||||
// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
|
||||
// usually more limited) implementations are used which allows to avoid the
|
||||
// dependency on the C++ run-time library.
|
||||
// Use standard C++ containers to implement all wx container classes.
|
||||
//
|
||||
// Default is 0 for compatibility reasons.
|
||||
//
|
||||
|
|
@ -321,30 +297,15 @@
|
|||
#define wxUSE_STD_CONTAINERS 0
|
||||
|
||||
// Use standard C++ streams if 1 instead of wx streams in some places. If
|
||||
// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
|
||||
// standard streams library.
|
||||
// disabled, wx streams are used instead.
|
||||
//
|
||||
// Notice that enabling this does not replace wx streams with std streams
|
||||
// everywhere, in a lot of places wx streams are used no matter what.
|
||||
//
|
||||
// Default is 1 if compiler supports it.
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting: 1 if you use the standard streams anyhow and so
|
||||
// dependency on the standard streams library is not a
|
||||
// problem
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
// Enable minimal interoperability with the standard C++ string class if 1.
|
||||
// "Minimal" means that wxString can be constructed from std::string or
|
||||
// std::wstring but can't be implicitly converted to them. You need to enable
|
||||
// the option below for the latter.
|
||||
//
|
||||
// Default is 1 for most compilers.
|
||||
//
|
||||
// Recommended setting: 1 unless you want to ensure your program doesn't use
|
||||
// the standard C++ library at all.
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
|
||||
// Recommended setting: 1.
|
||||
#define wxUSE_STD_IOSTREAM 1
|
||||
// Make wxString as much interchangeable with std::[w]string as possible, in
|
||||
// particular allow implicit conversion of wxString to either of these classes.
|
||||
// This comes at a price (or a benefit, depending on your point of view) of not
|
||||
|
|
@ -354,6 +315,10 @@
|
|||
// disabled by default but can be enabled for your build if you don't care
|
||||
// about compatibility.
|
||||
//
|
||||
// Note that wxString can always be constructed from std::[w]string, whether
|
||||
// this option is turned on or off, it only enables implicit conversion in the
|
||||
// other direction.
|
||||
//
|
||||
// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
|
||||
//
|
||||
// Recommended setting: 0 to remain compatible with the official builds of
|
||||
|
|
|
|||
|
|
@ -290,35 +290,11 @@
|
|||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 as the options below already provide a relatively
|
||||
// good level of interoperability and changing this option arguably isn't worth
|
||||
// diverging from the official builds of the library.
|
||||
// Recommended setting: 1 for new code bases and if compatibility with the
|
||||
// official build of the library is not important, 0 otherwise.
|
||||
#define wxUSE_STL 0
|
||||
|
||||
// This is not a real option but is used as the default value for
|
||||
// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY.
|
||||
//
|
||||
// Set it to 0 if you want to disable the use of all standard classes
|
||||
// completely for some reason.
|
||||
#define wxUSE_STD_DEFAULT 1
|
||||
|
||||
// Use standard C++ containers where it can be done without breaking backwards
|
||||
// compatibility.
|
||||
//
|
||||
// This provides better interoperability with the standard library, e.g. with
|
||||
// this option on it's possible to insert std::vector<> into many wxWidgets
|
||||
// containers directly.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting is 1 unless you want to avoid all dependencies on the
|
||||
// standard library.
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
|
||||
// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
|
||||
// usually more limited) implementations are used which allows to avoid the
|
||||
// dependency on the C++ run-time library.
|
||||
// Use standard C++ containers to implement all wx container classes.
|
||||
//
|
||||
// Default is 0 for compatibility reasons.
|
||||
//
|
||||
|
|
@ -327,30 +303,15 @@
|
|||
#define wxUSE_STD_CONTAINERS 0
|
||||
|
||||
// Use standard C++ streams if 1 instead of wx streams in some places. If
|
||||
// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
|
||||
// standard streams library.
|
||||
// disabled, wx streams are used instead.
|
||||
//
|
||||
// Notice that enabling this does not replace wx streams with std streams
|
||||
// everywhere, in a lot of places wx streams are used no matter what.
|
||||
//
|
||||
// Default is 1 if compiler supports it.
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting: 1 if you use the standard streams anyhow and so
|
||||
// dependency on the standard streams library is not a
|
||||
// problem
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
// Enable minimal interoperability with the standard C++ string class if 1.
|
||||
// "Minimal" means that wxString can be constructed from std::string or
|
||||
// std::wstring but can't be implicitly converted to them. You need to enable
|
||||
// the option below for the latter.
|
||||
//
|
||||
// Default is 1 for most compilers.
|
||||
//
|
||||
// Recommended setting: 1 unless you want to ensure your program doesn't use
|
||||
// the standard C++ library at all.
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
|
||||
// Recommended setting: 1.
|
||||
#define wxUSE_STD_IOSTREAM 1
|
||||
// Make wxString as much interchangeable with std::[w]string as possible, in
|
||||
// particular allow implicit conversion of wxString to either of these classes.
|
||||
// This comes at a price (or a benefit, depending on your point of view) of not
|
||||
|
|
@ -360,6 +321,10 @@
|
|||
// disabled by default but can be enabled for your build if you don't care
|
||||
// about compatibility.
|
||||
//
|
||||
// Note that wxString can always be constructed from std::[w]string, whether
|
||||
// this option is turned on or off, it only enables implicit conversion in the
|
||||
// other direction.
|
||||
//
|
||||
// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
|
||||
//
|
||||
// Recommended setting: 0 to remain compatible with the official builds of
|
||||
|
|
|
|||
|
|
@ -280,35 +280,11 @@
|
|||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 as the options below already provide a relatively
|
||||
// good level of interoperability and changing this option arguably isn't worth
|
||||
// diverging from the official builds of the library.
|
||||
// Recommended setting: 1 for new code bases and if compatibility with the
|
||||
// official build of the library is not important, 0 otherwise.
|
||||
#define wxUSE_STL 0
|
||||
|
||||
// This is not a real option but is used as the default value for
|
||||
// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY.
|
||||
//
|
||||
// Set it to 0 if you want to disable the use of all standard classes
|
||||
// completely for some reason.
|
||||
#define wxUSE_STD_DEFAULT 1
|
||||
|
||||
// Use standard C++ containers where it can be done without breaking backwards
|
||||
// compatibility.
|
||||
//
|
||||
// This provides better interoperability with the standard library, e.g. with
|
||||
// this option on it's possible to insert std::vector<> into many wxWidgets
|
||||
// containers directly.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting is 1 unless you want to avoid all dependencies on the
|
||||
// standard library.
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
|
||||
// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
|
||||
// usually more limited) implementations are used which allows to avoid the
|
||||
// dependency on the C++ run-time library.
|
||||
// Use standard C++ containers to implement all wx container classes.
|
||||
//
|
||||
// Default is 0 for compatibility reasons.
|
||||
//
|
||||
|
|
@ -317,30 +293,15 @@
|
|||
#define wxUSE_STD_CONTAINERS 0
|
||||
|
||||
// Use standard C++ streams if 1 instead of wx streams in some places. If
|
||||
// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
|
||||
// standard streams library.
|
||||
// disabled, wx streams are used instead.
|
||||
//
|
||||
// Notice that enabling this does not replace wx streams with std streams
|
||||
// everywhere, in a lot of places wx streams are used no matter what.
|
||||
//
|
||||
// Default is 1 if compiler supports it.
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting: 1 if you use the standard streams anyhow and so
|
||||
// dependency on the standard streams library is not a
|
||||
// problem
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
// Enable minimal interoperability with the standard C++ string class if 1.
|
||||
// "Minimal" means that wxString can be constructed from std::string or
|
||||
// std::wstring but can't be implicitly converted to them. You need to enable
|
||||
// the option below for the latter.
|
||||
//
|
||||
// Default is 1 for most compilers.
|
||||
//
|
||||
// Recommended setting: 1 unless you want to ensure your program doesn't use
|
||||
// the standard C++ library at all.
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
|
||||
// Recommended setting: 1.
|
||||
#define wxUSE_STD_IOSTREAM 1
|
||||
// Make wxString as much interchangeable with std::[w]string as possible, in
|
||||
// particular allow implicit conversion of wxString to either of these classes.
|
||||
// This comes at a price (or a benefit, depending on your point of view) of not
|
||||
|
|
@ -350,6 +311,10 @@
|
|||
// disabled by default but can be enabled for your build if you don't care
|
||||
// about compatibility.
|
||||
//
|
||||
// Note that wxString can always be constructed from std::[w]string, whether
|
||||
// this option is turned on or off, it only enables implicit conversion in the
|
||||
// other direction.
|
||||
//
|
||||
// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
|
||||
//
|
||||
// Recommended setting: 0 to remain compatible with the official builds of
|
||||
|
|
|
|||
|
|
@ -33,14 +33,18 @@
|
|||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "wx/chartype.h" // for wxChar
|
||||
#include "wx/wxcrtbase.h" // for wxChar, wxStrlen() etc.
|
||||
#include "wx/strvararg.h"
|
||||
#include "wx/buffer.h" // for wxCharBuffer
|
||||
#include "wx/strconv.h" // for wxConvertXXX() macros and wxMBConv classes
|
||||
#include "wx/stringimpl.h"
|
||||
#include "wx/stringops.h"
|
||||
#include "wx/unichar.h"
|
||||
|
||||
#include "wx/beforestd.h"
|
||||
#include <string>
|
||||
#include "wx/afterstd.h"
|
||||
|
||||
// by default we cache the mapping of the positions in UTF-8 string to the byte
|
||||
// offset as this results in noticeable performance improvements for loops over
|
||||
// strings using indices; comment out this line to disable this
|
||||
|
|
@ -92,6 +96,32 @@ namespace wxPrivate
|
|||
template <typename T> struct wxStringAsBufHelper;
|
||||
}
|
||||
|
||||
// All the symbols here only exist for compatibility in case they're referenced
|
||||
// in the existing code.
|
||||
#define wxUSE_STL_BASED_WXSTRING 1
|
||||
|
||||
// Define this for compatibility only, it is not used any longer.
|
||||
typedef std::wstring wxStdWideString;
|
||||
|
||||
#if wxUSE_UNICODE_WCHAR
|
||||
typedef std::wstring wxStdString;
|
||||
#else
|
||||
typedef std::string wxStdString;
|
||||
#endif
|
||||
|
||||
typedef wxStdString wxStringImpl;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// global pointer to empty string
|
||||
extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxEmptyString;
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
// FIXME-UTF8: we should have only one wxEmptyString
|
||||
extern WXDLLIMPEXP_DATA_BASE(const wxStringCharType*) wxEmptyStringImpl;
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -673,7 +703,6 @@ public:
|
|||
typedef size_t size_type;
|
||||
typedef const wxUniChar const_reference;
|
||||
|
||||
#if wxUSE_STD_STRING
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
// random access is not O(1), as required by Random Access Iterator
|
||||
#define WX_STR_ITERATOR_TAG std::bidirectional_iterator_tag
|
||||
|
|
@ -681,12 +710,6 @@ public:
|
|||
#define WX_STR_ITERATOR_TAG std::random_access_iterator_tag
|
||||
#endif
|
||||
#define WX_DEFINE_ITERATOR_CATEGORY(cat) typedef cat iterator_category;
|
||||
#else
|
||||
// not defining iterator_category at all in this case is better than defining
|
||||
// it as some dummy type -- at least it results in more intelligible error
|
||||
// messages
|
||||
#define WX_DEFINE_ITERATOR_CATEGORY(cat)
|
||||
#endif
|
||||
|
||||
#define WX_STR_ITERATOR_IMPL(iterator_name, pointer_type, reference_type) \
|
||||
private: \
|
||||
|
|
@ -1053,7 +1076,7 @@ private:
|
|||
// instead we define dummy type that lets us have wxString ctor for creation
|
||||
// from wxStringImpl that couldn't be used by user code (in all other builds,
|
||||
// "standard" ctors can be used):
|
||||
#if wxUSE_UNICODE_UTF8 && wxUSE_STL_BASED_WXSTRING
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
struct CtorFromStringImplTag {};
|
||||
|
||||
wxString(CtorFromStringImplTag* WXUNUSED(dummy), const wxStringImpl& src)
|
||||
|
|
@ -1062,10 +1085,6 @@ private:
|
|||
static wxString FromImpl(const wxStringImpl& src)
|
||||
{ return wxString((CtorFromStringImplTag*)nullptr, src); }
|
||||
#else
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
wxString(const wxStringImpl& src) : m_impl(src) { }
|
||||
// else: already defined as wxString(wxStdString) below
|
||||
#endif
|
||||
static wxString FromImpl(const wxStringImpl& src) { return wxString(src); }
|
||||
#endif
|
||||
|
||||
|
|
@ -1181,14 +1200,6 @@ public:
|
|||
}
|
||||
#endif // wxUSE_STRING_POS_CACHE
|
||||
|
||||
// even if we're not built with wxUSE_STD_STRING_CONV_IN_WXSTRING == 1 it is
|
||||
// very convenient to allow implicit conversions from std::string to wxString
|
||||
// and vice verse as this allows to use the same strings in non-GUI and GUI
|
||||
// code, however we don't want to unconditionally add this ctor as it would
|
||||
// make wx lib dependent on libstdc++ on some Linux versions which is bad, so
|
||||
// instead we ask the client code to define this wxUSE_STD_STRING symbol if
|
||||
// they need it
|
||||
#if wxUSE_STD_STRING
|
||||
#if wxUSE_UNICODE_WCHAR
|
||||
wxString(const std::wstring& str) : m_impl(str) {}
|
||||
#else // UTF-8 or ANSI
|
||||
|
|
@ -1200,14 +1211,12 @@ public:
|
|||
wxString(const std::string& str)
|
||||
{ assign(str.c_str(), str.length()); }
|
||||
#endif // wxNO_IMPLICIT_WXSTRING_ENCODING
|
||||
#endif // wxUSE_STD_STRING
|
||||
|
||||
// Also always provide explicit conversions to std::[w]string in any case,
|
||||
// see below for the implicit ones.
|
||||
#if wxUSE_STD_STRING
|
||||
// We can avoid a copy if we already use this string type internally,
|
||||
// otherwise we create a copy on the fly:
|
||||
#if wxUSE_UNICODE_WCHAR && wxUSE_STL_BASED_WXSTRING
|
||||
#if wxUSE_UNICODE_WCHAR
|
||||
#define wxStringToStdWstringRetType const std::wstring&
|
||||
const std::wstring& ToStdWstring() const { return m_impl; }
|
||||
#else
|
||||
|
|
@ -1226,7 +1235,7 @@ public:
|
|||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_UTF8_LOCALE_ONLY && wxUSE_STL_BASED_WXSTRING
|
||||
#if wxUSE_UTF8_LOCALE_ONLY
|
||||
// wxStringImpl is std::string in the encoding we want
|
||||
#define wxStringToStdStringRetType const std::string&
|
||||
const std::string& ToStdString() const { return m_impl; }
|
||||
|
|
@ -1261,8 +1270,6 @@ public:
|
|||
#undef wxStringToStdStringRetType
|
||||
#undef wxStringToStdWstringRetType
|
||||
|
||||
#endif // wxUSE_STD_STRING
|
||||
|
||||
wxString Clone() const
|
||||
{
|
||||
// make a deep copy of the string, i.e. the returned string will have
|
||||
|
|
@ -1605,14 +1612,9 @@ public:
|
|||
return FromImpl(wxStringImpl(utf8, len));
|
||||
}
|
||||
|
||||
#if wxUSE_STD_STRING
|
||||
static wxString FromUTF8Unchecked(const std::string& utf8)
|
||||
{
|
||||
wxASSERT( wxStringOperations::IsValidUtf8String(utf8.c_str(), utf8.length()) );
|
||||
/*
|
||||
Note that, under wxUSE_UNICODE_UTF8 and wxUSE_STD_STRING, wxStringImpl can be
|
||||
initialized with a std::string whether wxUSE_STL_BASED_WXSTRING is 1 or not.
|
||||
*/
|
||||
return FromImpl(utf8);
|
||||
}
|
||||
static wxString FromUTF8(const std::string& utf8)
|
||||
|
|
@ -1623,7 +1625,6 @@ public:
|
|||
}
|
||||
|
||||
std::string utf8_string() const { return m_impl; }
|
||||
#endif
|
||||
|
||||
const wxScopedCharBuffer utf8_str() const
|
||||
{ return wxCharBuffer::CreateNonOwned(m_impl.c_str(), m_impl.length()); }
|
||||
|
|
@ -1641,14 +1642,12 @@ public:
|
|||
"string must be valid UTF-8" );
|
||||
return s;
|
||||
}
|
||||
#if wxUSE_STD_STRING
|
||||
static wxString FromUTF8(const std::string& utf8)
|
||||
{ return FromUTF8(utf8.c_str(), utf8.length()); }
|
||||
static wxString FromUTF8Unchecked(const std::string& utf8)
|
||||
{ return FromUTF8Unchecked(utf8.c_str(), utf8.length()); }
|
||||
|
||||
std::string utf8_string() const { return ToStdString(wxMBConvUTF8()); }
|
||||
#endif
|
||||
const wxScopedCharBuffer utf8_str() const { return mb_str(wxMBConvUTF8()); }
|
||||
#else // ANSI
|
||||
static wxString FromUTF8(const char *utf8)
|
||||
|
|
@ -1676,14 +1675,12 @@ public:
|
|||
|
||||
return wxString(buf.data(), wlen);
|
||||
}
|
||||
#if wxUSE_STD_STRING
|
||||
static wxString FromUTF8(const std::string& utf8)
|
||||
{ return FromUTF8(utf8.c_str(), utf8.length()); }
|
||||
static wxString FromUTF8Unchecked(const std::string& utf8)
|
||||
{ return FromUTF8Unchecked(utf8.c_str(), utf8.length()); }
|
||||
|
||||
std::string utf8_string() const { return ToStdString(wxMBConvUTF8()); }
|
||||
#endif
|
||||
const wxScopedCharBuffer utf8_str() const
|
||||
{
|
||||
if (empty())
|
||||
|
|
@ -1798,7 +1795,6 @@ public:
|
|||
{ return operator=(wxUniChar(ch)); }
|
||||
// from a C string - STL probably will crash on nullptr,
|
||||
// so we need to compensate in that case
|
||||
#if wxUSE_STL_BASED_WXSTRING
|
||||
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
|
||||
wxString& operator=(const char *psz)
|
||||
{
|
||||
|
|
@ -1824,27 +1820,6 @@ public:
|
|||
|
||||
return *this;
|
||||
}
|
||||
#else // !wxUSE_STL_BASED_WXSTRING
|
||||
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
|
||||
wxString& operator=(const char *psz)
|
||||
{
|
||||
wxSTRING_INVALIDATE_CACHE();
|
||||
|
||||
m_impl = ImplStr(psz);
|
||||
|
||||
return *this;
|
||||
}
|
||||
#endif // wxNO_IMPLICIT_WXSTRING_ENCODING
|
||||
|
||||
wxString& operator=(const wchar_t *pwz)
|
||||
{
|
||||
wxSTRING_INVALIDATE_CACHE();
|
||||
|
||||
m_impl = ImplStr(pwz);
|
||||
|
||||
return *this;
|
||||
}
|
||||
#endif // wxUSE_STL_BASED_WXSTRING/!wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
|
||||
wxString& operator=(const unsigned char *psz)
|
||||
|
|
@ -3081,7 +3056,7 @@ public:
|
|||
{ return rfind(wxUniChar(ch), nStart); }
|
||||
|
||||
// find first/last occurrence of any character (not) in the set:
|
||||
#if wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8
|
||||
#if !wxUSE_UNICODE_UTF8
|
||||
// FIXME-UTF8: this is not entirely correct, because it doesn't work if
|
||||
// sizeof(wchar_t)==2 and surrogates are present in the string;
|
||||
// should we care? Probably not.
|
||||
|
|
@ -3217,7 +3192,7 @@ public:
|
|||
size_t find_last_not_of(const wchar_t* sz, size_t nStart, size_t n) const;
|
||||
// same as above
|
||||
size_t find_last_not_of(wxUniChar ch, size_t nStart = npos) const;
|
||||
#endif // wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 or not
|
||||
#endif // !wxUSE_UNICODE_UTF8
|
||||
|
||||
// provide char/wchar_t/wxUniCharRef overloads for char-finding functions
|
||||
// above to resolve ambiguities:
|
||||
|
|
@ -3398,28 +3373,6 @@ public:
|
|||
wxString& operator+=(wchar_t ch) { return *this += wxUniChar(ch); }
|
||||
|
||||
private:
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
// helpers for wxStringBuffer and wxStringBufferLength
|
||||
wxStringCharType *DoGetWriteBuf(size_t nLen)
|
||||
{
|
||||
return m_impl.DoGetWriteBuf(nLen);
|
||||
}
|
||||
|
||||
void DoUngetWriteBuf()
|
||||
{
|
||||
wxSTRING_INVALIDATE_CACHE();
|
||||
|
||||
m_impl.DoUngetWriteBuf();
|
||||
}
|
||||
|
||||
void DoUngetWriteBuf(size_t nLen)
|
||||
{
|
||||
wxSTRING_INVALIDATE_CACHE();
|
||||
|
||||
m_impl.DoUngetWriteBuf(nLen);
|
||||
}
|
||||
#endif // !wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
#if !wxUSE_UTF8_LOCALE_ONLY
|
||||
int DoPrintfWchar(const wxChar *format, ...);
|
||||
static wxString DoFormatWchar(const wxChar *format, ...);
|
||||
|
|
@ -3429,11 +3382,6 @@ private:
|
|||
static wxString DoFormatUtf8(const char *format, ...);
|
||||
#endif
|
||||
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
// check string's data validity
|
||||
bool IsValid() const { return m_impl.GetStringData()->IsValid(); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
wxStringImpl m_impl;
|
||||
|
||||
|
|
@ -3681,61 +3629,6 @@ struct wxStringAsBufHelper<wchar_t>
|
|||
// wxStringBuffer: a tiny class allowing to get a writable pointer into string
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
// string buffer for direct access to string data in their native
|
||||
// representation:
|
||||
class wxStringInternalBuffer
|
||||
{
|
||||
public:
|
||||
typedef wxStringCharType CharType;
|
||||
|
||||
wxStringInternalBuffer(wxString& str, size_t lenWanted = 1024)
|
||||
: m_str(str), m_buf(nullptr)
|
||||
{ m_buf = m_str.DoGetWriteBuf(lenWanted); }
|
||||
|
||||
~wxStringInternalBuffer() { m_str.DoUngetWriteBuf(); }
|
||||
|
||||
operator wxStringCharType*() const { return m_buf; }
|
||||
|
||||
private:
|
||||
wxString& m_str;
|
||||
wxStringCharType *m_buf;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxStringInternalBuffer);
|
||||
};
|
||||
|
||||
class wxStringInternalBufferLength
|
||||
{
|
||||
public:
|
||||
typedef wxStringCharType CharType;
|
||||
|
||||
wxStringInternalBufferLength(wxString& str, size_t lenWanted = 1024)
|
||||
: m_str(str), m_buf(nullptr), m_len(0), m_lenSet(false)
|
||||
{
|
||||
m_buf = m_str.DoGetWriteBuf(lenWanted);
|
||||
wxASSERT(m_buf != nullptr);
|
||||
}
|
||||
|
||||
~wxStringInternalBufferLength()
|
||||
{
|
||||
wxASSERT(m_lenSet);
|
||||
m_str.DoUngetWriteBuf(m_len);
|
||||
}
|
||||
|
||||
operator wxStringCharType*() const { return m_buf; }
|
||||
void SetLength(size_t length) { m_len = length; m_lenSet = true; }
|
||||
|
||||
private:
|
||||
wxString& m_str;
|
||||
wxStringCharType *m_buf;
|
||||
size_t m_len;
|
||||
bool m_lenSet;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxStringInternalBufferLength);
|
||||
};
|
||||
|
||||
#endif // !wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
template<typename T>
|
||||
class wxStringTypeBufferBase
|
||||
{
|
||||
|
|
@ -3828,8 +3721,6 @@ public:
|
|||
wxDECLARE_NO_COPY_CLASS(wxStringTypeBufferLength);
|
||||
};
|
||||
|
||||
#if wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
class wxStringInternalBuffer : public wxStringTypeBufferBase<wxStringCharType>
|
||||
{
|
||||
public:
|
||||
|
|
@ -3856,16 +3747,13 @@ public:
|
|||
wxDECLARE_NO_COPY_CLASS(wxStringInternalBufferLength);
|
||||
};
|
||||
|
||||
#endif // wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
|
||||
#if wxUSE_STL_BASED_WXSTRING || wxUSE_UNICODE_UTF8
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
typedef wxStringTypeBuffer<wxChar> wxStringBuffer;
|
||||
typedef wxStringTypeBufferLength<wxChar> wxStringBufferLength;
|
||||
#else // if !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8
|
||||
#else // !wxUSE_UNICODE_UTF8
|
||||
typedef wxStringInternalBuffer wxStringBuffer;
|
||||
typedef wxStringInternalBufferLength wxStringBufferLength;
|
||||
#endif // !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8
|
||||
#endif // wxUSE_UNICODE_UTF8/!wxUSE_UNICODE_UTF8
|
||||
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
typedef wxStringInternalBuffer wxUTF8StringBuffer;
|
||||
|
|
@ -4063,11 +3951,6 @@ wxDEFINE_ALL_COMPARISONS(const char *, const wxCStrData&, wxCMP_CHAR_CSTRDATA)
|
|||
// Implement hashing using C++11 std::hash<>.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Don't do this if ToStdWstring() is not available. We could work around it
|
||||
// but, presumably, if using std::wstring is undesirable, then so is using
|
||||
// std::hash<> anyhow.
|
||||
#if wxUSE_STD_STRING
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace std
|
||||
|
|
@ -4082,8 +3965,6 @@ namespace std
|
|||
};
|
||||
} // namespace std
|
||||
|
||||
#endif // wxUSE_STD_STRING
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Implementation only from here until the end of file
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,552 +0,0 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/stringimpl.h
|
||||
// Purpose: wxStringImpl class, implementation of wxString
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 29/01/98
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
This header implements std::string-like string class, wxStringImpl, that is
|
||||
used by wxString to store the data. Alternatively, if wxUSE_STD_STRING=1,
|
||||
wxStringImpl is just a typedef to std:: string class.
|
||||
*/
|
||||
|
||||
#ifndef _WX_WXSTRINGIMPL_H__
|
||||
#define _WX_WXSTRINGIMPL_H__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h" // everybody should include this
|
||||
#include "wx/chartype.h" // for wxChar
|
||||
#include "wx/wxcrtbase.h" // for wxStrlen() etc.
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// implementation only
|
||||
#define wxASSERT_VALID_INDEX(i) \
|
||||
wxASSERT_MSG( (size_t)(i) <= length(), wxT("invalid index in wxString") )
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// global pointer to empty string
|
||||
extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxEmptyString;
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
// FIXME-UTF8: we should have only one wxEmptyString
|
||||
extern WXDLLIMPEXP_DATA_BASE(const wxStringCharType*) wxEmptyStringImpl;
|
||||
#endif
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// deal with various build options
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// we use STL-based string internally if we use std::string at all now, there
|
||||
// should be no reason to prefer our internal implement but if you really need
|
||||
// it you can predefine wxUSE_STL_BASED_WXSTRING as 0 when building the library
|
||||
#ifndef wxUSE_STL_BASED_WXSTRING
|
||||
#define wxUSE_STL_BASED_WXSTRING wxUSE_STD_STRING
|
||||
#endif
|
||||
|
||||
// in both cases we need to define wxStdString
|
||||
#if wxUSE_STL_BASED_WXSTRING || wxUSE_STD_STRING
|
||||
|
||||
#include "wx/beforestd.h"
|
||||
#include <string>
|
||||
#include "wx/afterstd.h"
|
||||
|
||||
// Define this for compatibility only, it is not used any longer.
|
||||
typedef std::wstring wxStdWideString;
|
||||
|
||||
#if wxUSE_UNICODE_WCHAR
|
||||
typedef std::wstring wxStdString;
|
||||
#else
|
||||
typedef std::string wxStdString;
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_STL_BASED_WXSTRING || wxUSE_STD_STRING
|
||||
|
||||
|
||||
#if wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
// we always want ctor from std::string when using std::string internally
|
||||
#undef wxUSE_STD_STRING
|
||||
#define wxUSE_STD_STRING 1
|
||||
|
||||
typedef wxStdString wxStringImpl;
|
||||
#else // if !wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// string data prepended with some housekeeping info (used by wxString class),
|
||||
// is never used directly (but had to be put here to allow inlining)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
struct WXDLLIMPEXP_BASE wxStringData
|
||||
{
|
||||
int nRefs; // reference count
|
||||
size_t nDataLength, // actual string length
|
||||
nAllocLength; // allocated memory size
|
||||
|
||||
// mimics declaration 'wxStringCharType data[nAllocLength]'
|
||||
wxStringCharType* data() { return reinterpret_cast<wxStringCharType*>(this + 1); }
|
||||
const wxStringCharType* data() const { return reinterpret_cast<const wxStringCharType*>(this + 1); }
|
||||
|
||||
// empty string has a special ref count so it's never deleted
|
||||
bool IsEmpty() const { return (nRefs == -1); }
|
||||
bool IsShared() const { return (nRefs > 1); }
|
||||
|
||||
// lock/unlock
|
||||
void Lock() { if ( !IsEmpty() ) nRefs++; }
|
||||
|
||||
// VC++ will refuse to inline Unlock but profiling shows that it is wrong
|
||||
#if defined(__VISUALC__)
|
||||
__forceinline
|
||||
#endif
|
||||
// VC++ free must take place in same DLL as allocation when using non dll
|
||||
// run-time library (e.g. Multithreaded instead of Multithreaded DLL)
|
||||
#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL)
|
||||
void Unlock() { if ( !IsEmpty() && --nRefs == 0) Free(); }
|
||||
// we must not inline deallocation since allocation is not inlined
|
||||
void Free();
|
||||
#else
|
||||
void Unlock() { if ( !IsEmpty() && --nRefs == 0) free(this); }
|
||||
#endif
|
||||
|
||||
// if we had taken control over string memory (GetWriteBuf), it's
|
||||
// intentionally put in invalid state
|
||||
void Validate(bool b) { nRefs = (b ? 1 : 0); }
|
||||
bool IsValid() const { return (nRefs != 0); }
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_BASE wxStringImpl
|
||||
{
|
||||
public:
|
||||
// an 'invalid' value for string index, moved to this place due to a CW bug
|
||||
static const size_t npos;
|
||||
|
||||
protected:
|
||||
// points to data preceded by wxStringData structure with ref count info
|
||||
wxStringCharType *m_pchData;
|
||||
|
||||
// accessor to string data
|
||||
wxStringData* GetStringData() const { return (wxStringData*)m_pchData - 1; }
|
||||
|
||||
// string (re)initialization functions
|
||||
// initializes the string to the empty value (must be called only from
|
||||
// ctors, use Reinit() otherwise)
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
void Init() { m_pchData = const_cast<wxStringCharType*>(wxEmptyStringImpl); } // FIXME-UTF8
|
||||
#else
|
||||
void Init() { m_pchData = const_cast<wxStringCharType*>(wxEmptyString); }
|
||||
#endif
|
||||
// initializes the string with (a part of) C-string
|
||||
void InitWith(const wxStringCharType *psz, size_t nPos = 0, size_t nLen = npos);
|
||||
// as Init, but also frees old data
|
||||
void Reinit() { GetStringData()->Unlock(); Init(); }
|
||||
|
||||
// memory allocation
|
||||
// allocates memory for string of length nLen
|
||||
bool AllocBuffer(size_t nLen);
|
||||
// effectively copies data to string
|
||||
bool AssignCopy(size_t, const wxStringCharType *);
|
||||
|
||||
// append a (sub)string
|
||||
bool ConcatSelf(size_t nLen, const wxStringCharType *src, size_t nMaxLen);
|
||||
bool ConcatSelf(size_t nLen, const wxStringCharType *src)
|
||||
{ return ConcatSelf(nLen, src, nLen); }
|
||||
|
||||
// functions called before writing to the string: they copy it if there
|
||||
// are other references to our data (should be the only owner when writing)
|
||||
bool CopyBeforeWrite();
|
||||
bool AllocBeforeWrite(size_t);
|
||||
|
||||
// compatibility with wxString
|
||||
bool Alloc(size_t nLen);
|
||||
|
||||
public:
|
||||
// standard types
|
||||
typedef wxStringCharType value_type;
|
||||
typedef wxStringCharType char_type;
|
||||
typedef size_t size_type;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
typedef value_type* pointer;
|
||||
typedef const value_type* const_pointer;
|
||||
|
||||
// macro to define the bulk of iterator and const_iterator classes
|
||||
#define WX_DEFINE_STRINGIMPL_ITERATOR(iterator_name, ref_type, ptr_type) \
|
||||
public: \
|
||||
typedef wxStringCharType value_type; \
|
||||
typedef ref_type reference; \
|
||||
typedef ptr_type pointer; \
|
||||
typedef int difference_type; \
|
||||
\
|
||||
iterator_name() : m_ptr(nullptr) { } \
|
||||
iterator_name(pointer ptr) : m_ptr(ptr) { } \
|
||||
\
|
||||
reference operator*() const { return *m_ptr; } \
|
||||
\
|
||||
iterator_name& operator++() { m_ptr++; return *this; } \
|
||||
iterator_name operator++(int) \
|
||||
{ \
|
||||
const iterator_name tmp(*this); \
|
||||
m_ptr++; \
|
||||
return tmp; \
|
||||
} \
|
||||
\
|
||||
iterator_name& operator--() { m_ptr--; return *this; } \
|
||||
iterator_name operator--(int) \
|
||||
{ \
|
||||
const iterator_name tmp(*this); \
|
||||
m_ptr--; \
|
||||
return tmp; \
|
||||
} \
|
||||
\
|
||||
iterator_name operator+(ptrdiff_t n) const \
|
||||
{ return iterator_name(m_ptr + n); } \
|
||||
iterator_name operator-(ptrdiff_t n) const \
|
||||
{ return iterator_name(m_ptr - n); } \
|
||||
iterator_name& operator+=(ptrdiff_t n) \
|
||||
{ m_ptr += n; return *this; } \
|
||||
iterator_name& operator-=(ptrdiff_t n) \
|
||||
{ m_ptr -= n; return *this; } \
|
||||
\
|
||||
difference_type operator-(const iterator_name& i) const \
|
||||
{ return m_ptr - i.m_ptr; } \
|
||||
\
|
||||
bool operator==(const iterator_name& i) const \
|
||||
{ return m_ptr == i.m_ptr; } \
|
||||
bool operator!=(const iterator_name& i) const \
|
||||
{ return m_ptr != i.m_ptr; } \
|
||||
\
|
||||
bool operator<(const iterator_name& i) const \
|
||||
{ return m_ptr < i.m_ptr; } \
|
||||
bool operator>(const iterator_name& i) const \
|
||||
{ return m_ptr > i.m_ptr; } \
|
||||
bool operator<=(const iterator_name& i) const \
|
||||
{ return m_ptr <= i.m_ptr; } \
|
||||
bool operator>=(const iterator_name& i) const \
|
||||
{ return m_ptr >= i.m_ptr; } \
|
||||
\
|
||||
private: \
|
||||
/* for wxStringImpl use only */ \
|
||||
pointer GetPtr() const { return m_ptr; } \
|
||||
\
|
||||
friend class wxStringImpl; \
|
||||
\
|
||||
pointer m_ptr
|
||||
|
||||
// we need to declare const_iterator in wxStringImpl scope, the friend
|
||||
// declaration inside iterator class itself is not enough, or at least not
|
||||
// for g++ 3.4 (g++ 4 is ok)
|
||||
class WXDLLIMPEXP_FWD_BASE const_iterator;
|
||||
|
||||
class WXDLLIMPEXP_BASE iterator
|
||||
{
|
||||
WX_DEFINE_STRINGIMPL_ITERATOR(iterator,
|
||||
wxStringCharType&,
|
||||
wxStringCharType*);
|
||||
|
||||
friend class const_iterator;
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_BASE const_iterator
|
||||
{
|
||||
public:
|
||||
const_iterator(iterator i) : m_ptr(i.m_ptr) { }
|
||||
|
||||
WX_DEFINE_STRINGIMPL_ITERATOR(const_iterator,
|
||||
const wxStringCharType&,
|
||||
const wxStringCharType*);
|
||||
};
|
||||
|
||||
#undef WX_DEFINE_STRINGIMPL_ITERATOR
|
||||
|
||||
|
||||
// constructors and destructor
|
||||
// ctor for an empty string
|
||||
wxStringImpl() { Init(); }
|
||||
// copy ctor
|
||||
wxStringImpl(const wxStringImpl& stringSrc)
|
||||
{
|
||||
wxASSERT_MSG( stringSrc.GetStringData()->IsValid(),
|
||||
wxT("did you forget to call UngetWriteBuf()?") );
|
||||
|
||||
if ( stringSrc.empty() ) {
|
||||
// nothing to do for an empty string
|
||||
Init();
|
||||
}
|
||||
else {
|
||||
m_pchData = stringSrc.m_pchData; // share same data
|
||||
GetStringData()->Lock(); // => one more copy
|
||||
}
|
||||
}
|
||||
// string containing nRepeat copies of ch
|
||||
wxStringImpl(size_type nRepeat, wxStringCharType ch);
|
||||
// ctor takes first nLength characters from C string
|
||||
// (default value of npos means take all the string)
|
||||
wxStringImpl(const wxStringCharType *psz)
|
||||
{ InitWith(psz, 0, npos); }
|
||||
wxStringImpl(const wxStringCharType *psz, size_t nLength)
|
||||
{ InitWith(psz, 0, nLength); }
|
||||
// take nLen chars starting at nPos
|
||||
wxStringImpl(const wxStringImpl& str, size_t nPos, size_t nLen)
|
||||
{
|
||||
wxASSERT_MSG( str.GetStringData()->IsValid(),
|
||||
wxT("did you forget to call UngetWriteBuf()?") );
|
||||
Init();
|
||||
size_t strLen = str.length() - nPos; nLen = strLen < nLen ? strLen : nLen;
|
||||
InitWith(str.c_str(), nPos, nLen);
|
||||
}
|
||||
// take everything between start and end
|
||||
wxStringImpl(const_iterator start, const_iterator end);
|
||||
|
||||
|
||||
// ctor from and conversion to std::string
|
||||
#if wxUSE_STD_STRING
|
||||
wxStringImpl(const wxStdString& impl)
|
||||
{ InitWith(impl.c_str(), 0, impl.length()); }
|
||||
|
||||
operator wxStdString() const
|
||||
{ return wxStdString(c_str(), length()); }
|
||||
#endif
|
||||
|
||||
#if defined(__VISUALC__)
|
||||
// disable warning about Unlock() below not being inlined (first, it
|
||||
// seems to be inlined nevertheless and second, even if it isn't, there
|
||||
// is nothing we can do about this
|
||||
#pragma warning(push)
|
||||
#pragma warning (disable:4714)
|
||||
#endif
|
||||
|
||||
// dtor is not virtual, this class must not be inherited from!
|
||||
~wxStringImpl()
|
||||
{
|
||||
GetStringData()->Unlock();
|
||||
}
|
||||
|
||||
#if defined(__VISUALC__)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
// overloaded assignment
|
||||
// from another wxString
|
||||
wxStringImpl& operator=(const wxStringImpl& stringSrc);
|
||||
// from a character
|
||||
wxStringImpl& operator=(wxStringCharType ch);
|
||||
// from a C string
|
||||
wxStringImpl& operator=(const wxStringCharType *psz);
|
||||
|
||||
// return the length of the string
|
||||
size_type length() const { return GetStringData()->nDataLength; }
|
||||
// return the length of the string
|
||||
size_type size() const { return length(); }
|
||||
// return the maximum size of the string
|
||||
size_type max_size() const { return npos; }
|
||||
// resize the string, filling the space with c if c != 0
|
||||
void resize(size_t nSize, wxStringCharType ch = '\0');
|
||||
// delete the contents of the string
|
||||
void clear() { erase(0, npos); }
|
||||
// returns true if the string is empty
|
||||
bool empty() const { return length() == 0; }
|
||||
// inform string about planned change in size
|
||||
void reserve(size_t sz) { Alloc(sz); }
|
||||
size_type capacity() const { return GetStringData()->nAllocLength; }
|
||||
|
||||
// lib.string.access
|
||||
// return the character at position n
|
||||
value_type operator[](size_type n) const { return m_pchData[n]; }
|
||||
value_type at(size_type n) const
|
||||
{ wxASSERT_VALID_INDEX( n ); return m_pchData[n]; }
|
||||
// returns the writable character at position n
|
||||
reference operator[](size_type n) { CopyBeforeWrite(); return m_pchData[n]; }
|
||||
reference at(size_type n)
|
||||
{
|
||||
wxASSERT_VALID_INDEX( n );
|
||||
CopyBeforeWrite();
|
||||
return m_pchData[n];
|
||||
} // FIXME-UTF8: not useful for us...?
|
||||
|
||||
// lib.string.modifiers
|
||||
// append elements str[pos], ..., str[pos+n]
|
||||
wxStringImpl& append(const wxStringImpl& str, size_t pos, size_t n)
|
||||
{
|
||||
wxASSERT(pos <= str.length());
|
||||
ConcatSelf(n, str.c_str() + pos, str.length() - pos);
|
||||
return *this;
|
||||
}
|
||||
// append a string
|
||||
wxStringImpl& append(const wxStringImpl& str)
|
||||
{ ConcatSelf(str.length(), str.c_str()); return *this; }
|
||||
// append first n (or all if n == npos) characters of sz
|
||||
wxStringImpl& append(const wxStringCharType *sz)
|
||||
{ ConcatSelf(wxStrlen(sz), sz); return *this; }
|
||||
wxStringImpl& append(const wxStringCharType *sz, size_t n)
|
||||
{ ConcatSelf(n, sz); return *this; }
|
||||
// append n copies of ch
|
||||
wxStringImpl& append(size_t n, wxStringCharType ch);
|
||||
// append from first to last
|
||||
wxStringImpl& append(const_iterator first, const_iterator last)
|
||||
{ ConcatSelf(last - first, first.GetPtr()); return *this; }
|
||||
|
||||
// same as `this_string = str'
|
||||
wxStringImpl& assign(const wxStringImpl& str)
|
||||
{ return *this = str; }
|
||||
// same as ` = str[pos..pos + n]
|
||||
wxStringImpl& assign(const wxStringImpl& str, size_t pos, size_t n)
|
||||
{ return replace(0, npos, str, pos, n); }
|
||||
// same as `= first n (or all if n == npos) characters of sz'
|
||||
wxStringImpl& assign(const wxStringCharType *sz)
|
||||
{ return replace(0, npos, sz, wxStrlen(sz)); }
|
||||
wxStringImpl& assign(const wxStringCharType *sz, size_t n)
|
||||
{ return replace(0, npos, sz, n); }
|
||||
// same as `= n copies of ch'
|
||||
wxStringImpl& assign(size_t n, wxStringCharType ch)
|
||||
{ return replace(0, npos, n, ch); }
|
||||
// assign from first to last
|
||||
wxStringImpl& assign(const_iterator first, const_iterator last)
|
||||
{ return replace(begin(), end(), first, last); }
|
||||
|
||||
// first valid index position
|
||||
const_iterator begin() const { return m_pchData; }
|
||||
iterator begin();
|
||||
// position one after the last valid one
|
||||
const_iterator end() const { return m_pchData + length(); }
|
||||
iterator end();
|
||||
|
||||
// insert another string
|
||||
wxStringImpl& insert(size_t nPos, const wxStringImpl& str)
|
||||
{
|
||||
wxASSERT( str.GetStringData()->IsValid() );
|
||||
return insert(nPos, str.c_str(), str.length());
|
||||
}
|
||||
// insert n chars of str starting at nStart (in str)
|
||||
wxStringImpl& insert(size_t nPos, const wxStringImpl& str, size_t nStart, size_t n)
|
||||
{
|
||||
wxASSERT( str.GetStringData()->IsValid() );
|
||||
wxASSERT( nStart < str.length() );
|
||||
size_t strLen = str.length() - nStart;
|
||||
n = strLen < n ? strLen : n;
|
||||
return insert(nPos, str.c_str() + nStart, n);
|
||||
}
|
||||
// insert first n (or all if n == npos) characters of sz
|
||||
wxStringImpl& insert(size_t nPos, const wxStringCharType *sz, size_t n = npos);
|
||||
// insert n copies of ch
|
||||
wxStringImpl& insert(size_t nPos, size_t n, wxStringCharType ch)
|
||||
{ return insert(nPos, wxStringImpl(n, ch)); }
|
||||
iterator insert(iterator it, wxStringCharType ch)
|
||||
{ size_t idx = it - begin(); insert(idx, 1, ch); return begin() + idx; }
|
||||
void insert(iterator it, const_iterator first, const_iterator last)
|
||||
{ insert(it - begin(), first.GetPtr(), last - first); }
|
||||
void insert(iterator it, size_type n, wxStringCharType ch)
|
||||
{ insert(it - begin(), n, ch); }
|
||||
|
||||
// delete characters from nStart to nStart + nLen
|
||||
wxStringImpl& erase(size_type pos = 0, size_type n = npos);
|
||||
iterator erase(iterator first, iterator last)
|
||||
{
|
||||
size_t idx = first - begin();
|
||||
erase(idx, last - first);
|
||||
return begin() + idx;
|
||||
}
|
||||
iterator erase(iterator first);
|
||||
|
||||
// explicit conversion to C string (use this with printf()!)
|
||||
const wxStringCharType* c_str() const { return m_pchData; }
|
||||
const wxStringCharType* data() const { return m_pchData; }
|
||||
|
||||
// replaces the substring of length nLen starting at nStart
|
||||
wxStringImpl& replace(size_t nStart, size_t nLen, const wxStringCharType* sz)
|
||||
{ return replace(nStart, nLen, sz, npos); }
|
||||
// replaces the substring of length nLen starting at nStart
|
||||
wxStringImpl& replace(size_t nStart, size_t nLen, const wxStringImpl& str)
|
||||
{ return replace(nStart, nLen, str.c_str(), str.length()); }
|
||||
// replaces the substring with nCount copies of ch
|
||||
wxStringImpl& replace(size_t nStart, size_t nLen,
|
||||
size_t nCount, wxStringCharType ch)
|
||||
{ return replace(nStart, nLen, wxStringImpl(nCount, ch)); }
|
||||
// replaces a substring with another substring
|
||||
wxStringImpl& replace(size_t nStart, size_t nLen,
|
||||
const wxStringImpl& str, size_t nStart2, size_t nLen2)
|
||||
{ return replace(nStart, nLen, str.substr(nStart2, nLen2)); }
|
||||
// replaces the substring with first nCount chars of sz
|
||||
wxStringImpl& replace(size_t nStart, size_t nLen,
|
||||
const wxStringCharType* sz, size_t nCount);
|
||||
|
||||
wxStringImpl& replace(iterator first, iterator last, const_pointer s)
|
||||
{ return replace(first - begin(), last - first, s); }
|
||||
wxStringImpl& replace(iterator first, iterator last, const_pointer s,
|
||||
size_type n)
|
||||
{ return replace(first - begin(), last - first, s, n); }
|
||||
wxStringImpl& replace(iterator first, iterator last, const wxStringImpl& s)
|
||||
{ return replace(first - begin(), last - first, s); }
|
||||
wxStringImpl& replace(iterator first, iterator last, size_type n, wxStringCharType c)
|
||||
{ return replace(first - begin(), last - first, n, c); }
|
||||
wxStringImpl& replace(iterator first, iterator last,
|
||||
const_iterator first1, const_iterator last1)
|
||||
{ return replace(first - begin(), last - first, first1.GetPtr(), last1 - first1); }
|
||||
|
||||
// swap two strings
|
||||
void swap(wxStringImpl& str);
|
||||
|
||||
// All find() functions take the nStart argument which specifies the
|
||||
// position to start the search on, the default value is 0. All functions
|
||||
// return npos if there were no match.
|
||||
|
||||
// find a substring
|
||||
size_t find(const wxStringImpl& str, size_t nStart = 0) const;
|
||||
|
||||
// find first n characters of sz
|
||||
size_t find(const wxStringCharType* sz, size_t nStart = 0, size_t n = npos) const;
|
||||
|
||||
// find the first occurrence of character ch after nStart
|
||||
size_t find(wxStringCharType ch, size_t nStart = 0) const;
|
||||
|
||||
// rfind() family is exactly like find() but works right to left
|
||||
|
||||
// as find, but from the end
|
||||
size_t rfind(const wxStringImpl& str, size_t nStart = npos) const;
|
||||
|
||||
// as find, but from the end
|
||||
size_t rfind(const wxStringCharType* sz, size_t nStart = npos,
|
||||
size_t n = npos) const;
|
||||
// as find, but from the end
|
||||
size_t rfind(wxStringCharType ch, size_t nStart = npos) const;
|
||||
|
||||
size_type copy(wxStringCharType* s, size_type n, size_type pos = 0);
|
||||
|
||||
// substring extraction
|
||||
wxStringImpl substr(size_t nStart = 0, size_t nLen = npos) const;
|
||||
|
||||
// string += string
|
||||
wxStringImpl& operator+=(const wxStringImpl& s) { return append(s); }
|
||||
// string += C string
|
||||
wxStringImpl& operator+=(const wxStringCharType *psz) { return append(psz); }
|
||||
// string += char
|
||||
wxStringImpl& operator+=(wxStringCharType ch) { return append(1, ch); }
|
||||
|
||||
// helpers for wxStringBuffer and wxStringBufferLength
|
||||
wxStringCharType *DoGetWriteBuf(size_t nLen);
|
||||
void DoUngetWriteBuf();
|
||||
void DoUngetWriteBuf(size_t nLen);
|
||||
|
||||
friend class WXDLLIMPEXP_FWD_BASE wxString;
|
||||
};
|
||||
|
||||
#endif // !wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
// don't pollute the library user's name space
|
||||
#undef wxASSERT_VALID_INDEX
|
||||
|
||||
#endif // _WX_WXSTRINGIMPL_H__
|
||||
|
|
@ -12,10 +12,13 @@
|
|||
#define _WX_WXSTRINGOPS_H__
|
||||
|
||||
#include "wx/chartype.h"
|
||||
#include "wx/stringimpl.h"
|
||||
#include "wx/unichar.h"
|
||||
#include "wx/buffer.h"
|
||||
|
||||
#include "wx/beforestd.h"
|
||||
#include <string>
|
||||
#include "wx/afterstd.h"
|
||||
|
||||
// This header contains wxStringOperations "namespace" class that implements
|
||||
// elementary operations on string data as static methods; wxString methods and
|
||||
// iterators are implemented in terms of it. Two implementations are available,
|
||||
|
|
@ -76,7 +79,7 @@ struct WXDLLIMPEXP_BASE wxStringOperationsWchar
|
|||
static bool IsSingleCodeUnitCharacter(const wxUniChar&) { return true; }
|
||||
#endif
|
||||
|
||||
static wxUniChar DecodeChar(const wxStringImpl::const_iterator& i)
|
||||
static wxUniChar DecodeChar(const std::wstring::const_iterator& i)
|
||||
{ return *i; }
|
||||
};
|
||||
#endif // wxUSE_UNICODE_WCHAR
|
||||
|
|
@ -87,7 +90,7 @@ struct WXDLLIMPEXP_BASE wxStringOperationsUtf8
|
|||
{
|
||||
// checks correctness of UTF-8 sequence
|
||||
static bool IsValidUtf8String(const char *c,
|
||||
size_t len = wxStringImpl::npos);
|
||||
size_t len = std::string::npos);
|
||||
static bool IsValidUtf8LeadByte(unsigned char c)
|
||||
{
|
||||
return (c <= 0x7F) || (c >= 0xC2 && c <= 0xF4);
|
||||
|
|
@ -181,7 +184,7 @@ struct WXDLLIMPEXP_BASE wxStringOperationsUtf8
|
|||
}
|
||||
|
||||
// decodes single UTF-8 character from UTF-8 string
|
||||
static wxUniChar DecodeChar(wxStringImpl::const_iterator i)
|
||||
static wxUniChar DecodeChar(std::string::const_iterator i)
|
||||
{
|
||||
if ( (unsigned char)*i < 0x80 )
|
||||
return (int)*i;
|
||||
|
|
@ -189,7 +192,7 @@ struct WXDLLIMPEXP_BASE wxStringOperationsUtf8
|
|||
}
|
||||
|
||||
private:
|
||||
static wxUniChar DecodeNonAsciiChar(wxStringImpl::const_iterator i);
|
||||
static wxUniChar DecodeNonAsciiChar(std::string::const_iterator i);
|
||||
};
|
||||
#endif // wxUSE_UNICODE_UTF8
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,13 @@
|
|||
#include "wx/buffer.h"
|
||||
#include "wx/unichar.h"
|
||||
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#ifdef __cpp_lib_string_view
|
||||
#include <string_view>
|
||||
#endif // __cpp_lib_string_view
|
||||
|
||||
class WXDLLIMPEXP_FWD_BASE wxCStrData;
|
||||
class WXDLLIMPEXP_FWD_BASE wxString;
|
||||
|
||||
|
|
@ -721,18 +726,7 @@ WX_ARG_NORMALIZER_FORWARD(const wxCharBuffer&, const char*);
|
|||
WX_ARG_NORMALIZER_FORWARD(wxWCharBuffer, const wchar_t*);
|
||||
WX_ARG_NORMALIZER_FORWARD(const wxWCharBuffer&, const wchar_t*);
|
||||
|
||||
// versions for std::[w]string:
|
||||
#if wxUSE_STD_STRING
|
||||
|
||||
#include "wx/stringimpl.h"
|
||||
|
||||
// And also string_view, if we have it (notice that <string> was included from
|
||||
// wx/stringimpl.h above, so __cpp_lib_string_view should be defined if it's
|
||||
// supported).
|
||||
#ifdef __cpp_lib_string_view
|
||||
#include <string_view>
|
||||
#endif // __cpp_lib_string_view
|
||||
|
||||
// versions for std::[w]string and string_view, if we have it.
|
||||
#if !wxUSE_UTF8_LOCALE_ONLY
|
||||
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
|
||||
template<>
|
||||
|
|
@ -813,8 +807,6 @@ WX_ARG_NORMALIZER_FORWARD(std::string_view, const std::string_view&);
|
|||
#endif
|
||||
WX_ARG_NORMALIZER_FORWARD(std::wstring, const std::wstring&);
|
||||
|
||||
#endif // wxUSE_STD_STRING
|
||||
|
||||
|
||||
// versions for wxUniChar, wxUniCharRef:
|
||||
// (this is same for UTF-8 and Wchar builds, we just convert to wchar_t)
|
||||
|
|
|
|||
|
|
@ -12,14 +12,9 @@
|
|||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/chartype.h"
|
||||
#include "wx/stringimpl.h"
|
||||
|
||||
// We need to get std::swap() declaration in order to specialize it below and
|
||||
// it is declared in different headers for C++98 and C++11. Instead of testing
|
||||
// which one is being used, just include both of them as it's simpler and less
|
||||
// error-prone.
|
||||
#include <algorithm> // std::swap() for C++98
|
||||
#include <utility> // std::swap() for C++11
|
||||
#include <string>
|
||||
#include <utility> // std::swap() which we specialize below
|
||||
|
||||
class WXDLLIMPEXP_FWD_BASE wxUniCharRef;
|
||||
class WXDLLIMPEXP_FWD_BASE wxString;
|
||||
|
|
@ -210,7 +205,11 @@ private:
|
|||
class WXDLLIMPEXP_BASE wxUniCharRef
|
||||
{
|
||||
private:
|
||||
typedef wxStringImpl::iterator iterator;
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
typedef std::string::iterator iterator;
|
||||
#else
|
||||
typedef std::wstring::iterator iterator;
|
||||
#endif
|
||||
|
||||
// create the reference
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
|
|
|
|||
|
|
@ -283,35 +283,11 @@
|
|||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 as the options below already provide a relatively
|
||||
// good level of interoperability and changing this option arguably isn't worth
|
||||
// diverging from the official builds of the library.
|
||||
// Recommended setting: 1 for new code bases and if compatibility with the
|
||||
// official build of the library is not important, 0 otherwise.
|
||||
#define wxUSE_STL 0
|
||||
|
||||
// This is not a real option but is used as the default value for
|
||||
// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY.
|
||||
//
|
||||
// Set it to 0 if you want to disable the use of all standard classes
|
||||
// completely for some reason.
|
||||
#define wxUSE_STD_DEFAULT 1
|
||||
|
||||
// Use standard C++ containers where it can be done without breaking backwards
|
||||
// compatibility.
|
||||
//
|
||||
// This provides better interoperability with the standard library, e.g. with
|
||||
// this option on it's possible to insert std::vector<> into many wxWidgets
|
||||
// containers directly.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting is 1 unless you want to avoid all dependencies on the
|
||||
// standard library.
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
|
||||
// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
|
||||
// usually more limited) implementations are used which allows to avoid the
|
||||
// dependency on the C++ run-time library.
|
||||
// Use standard C++ containers to implement all wx container classes.
|
||||
//
|
||||
// Default is 0 for compatibility reasons.
|
||||
//
|
||||
|
|
@ -320,30 +296,15 @@
|
|||
#define wxUSE_STD_CONTAINERS 0
|
||||
|
||||
// Use standard C++ streams if 1 instead of wx streams in some places. If
|
||||
// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
|
||||
// standard streams library.
|
||||
// disabled, wx streams are used instead.
|
||||
//
|
||||
// Notice that enabling this does not replace wx streams with std streams
|
||||
// everywhere, in a lot of places wx streams are used no matter what.
|
||||
//
|
||||
// Default is 1 if compiler supports it.
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting: 1 if you use the standard streams anyhow and so
|
||||
// dependency on the standard streams library is not a
|
||||
// problem
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
// Enable minimal interoperability with the standard C++ string class if 1.
|
||||
// "Minimal" means that wxString can be constructed from std::string or
|
||||
// std::wstring but can't be implicitly converted to them. You need to enable
|
||||
// the option below for the latter.
|
||||
//
|
||||
// Default is 1 for most compilers.
|
||||
//
|
||||
// Recommended setting: 1 unless you want to ensure your program doesn't use
|
||||
// the standard C++ library at all.
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
|
||||
// Recommended setting: 1.
|
||||
#define wxUSE_STD_IOSTREAM 1
|
||||
// Make wxString as much interchangeable with std::[w]string as possible, in
|
||||
// particular allow implicit conversion of wxString to either of these classes.
|
||||
// This comes at a price (or a benefit, depending on your point of view) of not
|
||||
|
|
@ -353,6 +314,10 @@
|
|||
// disabled by default but can be enabled for your build if you don't care
|
||||
// about compatibility.
|
||||
//
|
||||
// Note that wxString can always be constructed from std::[w]string, whether
|
||||
// this option is turned on or off, it only enables implicit conversion in the
|
||||
// other direction.
|
||||
//
|
||||
// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
|
||||
//
|
||||
// Recommended setting: 0 to remain compatible with the official builds of
|
||||
|
|
|
|||
|
|
@ -231,7 +231,6 @@ public:
|
|||
inline operator wxString () const { return MakeString(); }
|
||||
wxString GetString() const;
|
||||
|
||||
#if wxUSE_STD_STRING
|
||||
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
|
||||
wxVariant(const std::string& val, const wxString& name = wxEmptyString);
|
||||
bool operator==(const std::string& value) const
|
||||
|
|
@ -251,7 +250,6 @@ public:
|
|||
wxVariant& operator=(const std::wstring& value)
|
||||
{ return operator=(wxString(value)); }
|
||||
operator std::wstring() const { return (operator wxString()).ToStdWstring(); }
|
||||
#endif // wxUSE_STD_STRING
|
||||
|
||||
// wxUniChar
|
||||
wxVariant(const wxUniChar& val, const wxString& name = wxEmptyString);
|
||||
|
|
|
|||
|
|
@ -614,8 +614,8 @@ WXDLLIMPEXP_BASE size_t wxCRT_StrftimeW(wchar_t *s, size_t max,
|
|||
#ifdef __cplusplus
|
||||
|
||||
/* NB: this belongs to wxcrt.h and not this header, but it makes life easier
|
||||
* for buffer.h and stringimpl.h (both of which must be included before
|
||||
* string.h, which is required by wxcrt.h) to have them here: */
|
||||
* for buffer.h which must be included before string.h, which is required
|
||||
* by wxcrt.h, to have them here: */
|
||||
|
||||
/* safe version of strlen() (returns 0 if passed null pointer) */
|
||||
inline size_t wxStrlen(const char *s) { return s ? wxCRT_StrlenA(s) : 0; }
|
||||
|
|
|
|||
|
|
@ -174,16 +174,9 @@
|
|||
|
||||
#define wxUSE_STL 0
|
||||
|
||||
#define wxUSE_STD_DEFAULT 0
|
||||
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
#define wxUSE_STD_CONTAINERS 0
|
||||
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
|
||||
#define wxUSE_STD_IOSTREAM 0
|
||||
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
|
||||
|
||||
|
||||
|
|
|
|||
15
setup.h_vms
15
setup.h_vms
|
|
@ -218,20 +218,7 @@ typedef pid_t GPid;
|
|||
|
||||
#define wxUSE_STL 0
|
||||
|
||||
#if defined(__DMC__) \
|
||||
|| (defined(_MSC_VER) && _MSC_VER < 1200)
|
||||
#define wxUSE_STD_DEFAULT 0
|
||||
#else
|
||||
#define wxUSE_STD_DEFAULT 1
|
||||
#endif
|
||||
|
||||
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
|
||||
|
||||
#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
|
||||
|
||||
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
|
||||
|
||||
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
|
||||
#define wxUSE_STD_CONTAINERS wxUSE_STL
|
||||
|
||||
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ OBJECTS1=fs_inet.obj,\
|
|||
strconv.obj,\
|
||||
stream.obj,\
|
||||
string.obj,\
|
||||
stringimpl.obj,\
|
||||
stringops.obj,\
|
||||
strvararg.obj,\
|
||||
sysopt.obj
|
||||
|
|
@ -376,7 +375,6 @@ SOURCES = \
|
|||
strvararg.cpp,\
|
||||
sysopt.cpp,\
|
||||
string.cpp,\
|
||||
stringimpl.cpp,\
|
||||
stringops.cpp,\
|
||||
tbarbase.cpp,\
|
||||
textbuf.cpp,\
|
||||
|
|
@ -615,7 +613,6 @@ stream.obj : stream.cpp
|
|||
strvararg.obj : strvararg.cpp
|
||||
sysopt.obj : sysopt.cpp
|
||||
string.obj : string.cpp
|
||||
stringimpl.obj : stringimpl.cpp
|
||||
stringops.obj : stringops.cpp
|
||||
tbarbase.obj : tbarbase.cpp
|
||||
textbuf.obj : textbuf.cpp
|
||||
|
|
|
|||
|
|
@ -44,17 +44,6 @@
|
|||
#include <sstream>
|
||||
#endif
|
||||
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
// string handling functions used by wxString:
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
#define wxStringMemcmp memcmp
|
||||
#define wxStringStrlen strlen
|
||||
#else
|
||||
#define wxStringMemcmp wxTmemcmp
|
||||
#define wxStringStrlen wxStrlen
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// define a function declared in wx/buffer.h here as we don't have buffer.cpp
|
||||
// and don't want to add it just because of this simple function
|
||||
namespace wxPrivate
|
||||
|
|
@ -79,6 +68,11 @@ UntypedBufferData *GetUntypedNullData()
|
|||
//According to STL _must_ be a -1 size_t
|
||||
const size_t wxString::npos = (size_t) -1;
|
||||
|
||||
// FIXME-UTF8: get rid of this, have only one wxEmptyString
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyStringImpl = "";
|
||||
#endif
|
||||
const wxChar WXDLLIMPEXP_BASE *wxEmptyString = wxT("");
|
||||
#if wxUSE_STRING_POS_CACHE
|
||||
|
||||
wxTHREAD_SPECIFIC_DECL wxString::Cache wxString::ms_cache;
|
||||
|
|
@ -542,11 +536,6 @@ bool wxString::Shrink()
|
|||
|
||||
wxString operator+(const wxString& str1, const wxString& str2)
|
||||
{
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
wxASSERT( str1.IsValid() );
|
||||
wxASSERT( str2.IsValid() );
|
||||
#endif
|
||||
|
||||
wxString s = str1;
|
||||
s += str2;
|
||||
|
||||
|
|
@ -555,10 +544,6 @@ wxString operator+(const wxString& str1, const wxString& str2)
|
|||
|
||||
wxString operator+(const wxString& str, wxUniChar ch)
|
||||
{
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
wxASSERT( str.IsValid() );
|
||||
#endif
|
||||
|
||||
wxString s = str;
|
||||
s += ch;
|
||||
|
||||
|
|
@ -567,10 +552,6 @@ wxString operator+(const wxString& str, wxUniChar ch)
|
|||
|
||||
wxString operator+(wxUniChar ch, const wxString& str)
|
||||
{
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
wxASSERT( str.IsValid() );
|
||||
#endif
|
||||
|
||||
wxString s = ch;
|
||||
s += str;
|
||||
|
||||
|
|
@ -579,10 +560,6 @@ wxString operator+(wxUniChar ch, const wxString& str)
|
|||
|
||||
wxString operator+(const wxString& str, const char *psz)
|
||||
{
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
wxASSERT( str.IsValid() );
|
||||
#endif
|
||||
|
||||
wxString s;
|
||||
if ( !s.Alloc(strlen(psz) + str.length()) ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxString::operator+") );
|
||||
|
|
@ -595,10 +572,6 @@ wxString operator+(const wxString& str, const char *psz)
|
|||
|
||||
wxString operator+(const wxString& str, const wchar_t *pwz)
|
||||
{
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
wxASSERT( str.IsValid() );
|
||||
#endif
|
||||
|
||||
wxString s;
|
||||
if ( !s.Alloc(wxWcslen(pwz) + str.length()) ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxString::operator+") );
|
||||
|
|
@ -611,10 +584,6 @@ wxString operator+(const wxString& str, const wchar_t *pwz)
|
|||
|
||||
wxString operator+(const char *psz, const wxString& str)
|
||||
{
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
wxASSERT( str.IsValid() );
|
||||
#endif
|
||||
|
||||
wxString s;
|
||||
if ( !s.Alloc(strlen(psz) + str.length()) ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxString::operator+") );
|
||||
|
|
@ -627,10 +596,6 @@ wxString operator+(const char *psz, const wxString& str)
|
|||
|
||||
wxString operator+(const wchar_t *pwz, const wxString& str)
|
||||
{
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
wxASSERT( str.IsValid() );
|
||||
#endif
|
||||
|
||||
wxString s;
|
||||
if ( !s.Alloc(wxWcslen(pwz) + str.length()) ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxString::operator+") );
|
||||
|
|
@ -651,12 +616,10 @@ bool wxString::IsSameAs(wxUniChar c, bool compareWithCase) const
|
|||
: wxToupper(GetChar(0u)) == wxToupper(c));
|
||||
}
|
||||
|
||||
#if wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
// NB: Comparison code (both if wxUSE_STL_BASED_WXSTRING and if not) works with
|
||||
// UTF-8 encoded strings too, thanks to UTF-8's design which allows us to
|
||||
// sort strings in characters code point order by sorting the byte sequence
|
||||
// in byte values order (i.e. what strcmp() and memcmp() do).
|
||||
// NB: Comparison code works with UTF-8 encoded strings too, thanks to UTF-8's
|
||||
// design which allows us to sort strings in characters code point order by
|
||||
// sorting the byte sequence in byte values order (i.e. what strcmp() and
|
||||
// memcmp() do).
|
||||
|
||||
int wxString::compare(const wxString& str) const
|
||||
{
|
||||
|
|
@ -716,123 +679,11 @@ int wxString::compare(size_t nStart, size_t nLen,
|
|||
return m_impl.compare(pos, len, str.data, str.len);
|
||||
}
|
||||
|
||||
#else // !wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
static inline int wxDoCmp(const wxStringCharType* s1, size_t l1,
|
||||
const wxStringCharType* s2, size_t l2)
|
||||
{
|
||||
if( l1 == l2 )
|
||||
return wxStringMemcmp(s1, s2, l1);
|
||||
else if( l1 < l2 )
|
||||
{
|
||||
int ret = wxStringMemcmp(s1, s2, l1);
|
||||
return ret == 0 ? -1 : ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
int ret = wxStringMemcmp(s1, s2, l2);
|
||||
return ret == 0 ? +1 : ret;
|
||||
}
|
||||
}
|
||||
|
||||
int wxString::compare(const wxString& str) const
|
||||
{
|
||||
return ::wxDoCmp(m_impl.data(), m_impl.length(),
|
||||
str.m_impl.data(), str.m_impl.length());
|
||||
}
|
||||
|
||||
int wxString::compare(size_t nStart, size_t nLen,
|
||||
const wxString& str) const
|
||||
{
|
||||
wxASSERT(nStart <= length());
|
||||
size_type strLen = length() - nStart;
|
||||
nLen = strLen < nLen ? strLen : nLen;
|
||||
|
||||
size_t pos, len;
|
||||
PosLenToImpl(nStart, nLen, &pos, &len);
|
||||
|
||||
return ::wxDoCmp(m_impl.data() + pos, len,
|
||||
str.m_impl.data(), str.m_impl.length());
|
||||
}
|
||||
|
||||
int wxString::compare(size_t nStart, size_t nLen,
|
||||
const wxString& str,
|
||||
size_t nStart2, size_t nLen2) const
|
||||
{
|
||||
wxASSERT(nStart <= length());
|
||||
wxASSERT(nStart2 <= str.length());
|
||||
size_type strLen = length() - nStart,
|
||||
strLen2 = str.length() - nStart2;
|
||||
nLen = strLen < nLen ? strLen : nLen;
|
||||
nLen2 = strLen2 < nLen2 ? strLen2 : nLen2;
|
||||
|
||||
size_t pos, len;
|
||||
PosLenToImpl(nStart, nLen, &pos, &len);
|
||||
size_t pos2, len2;
|
||||
str.PosLenToImpl(nStart2, nLen2, &pos2, &len2);
|
||||
|
||||
return ::wxDoCmp(m_impl.data() + pos, len,
|
||||
str.m_impl.data() + pos2, len2);
|
||||
}
|
||||
|
||||
int wxString::compare(const char* sz) const
|
||||
{
|
||||
SubstrBufFromMB str(ImplStr(sz, npos));
|
||||
if ( str.len == npos )
|
||||
str.len = wxStringStrlen(str.data);
|
||||
return ::wxDoCmp(m_impl.data(), m_impl.length(), str.data, str.len);
|
||||
}
|
||||
|
||||
int wxString::compare(const wchar_t* sz) const
|
||||
{
|
||||
SubstrBufFromWC str(ImplStr(sz, npos));
|
||||
if ( str.len == npos )
|
||||
str.len = wxStringStrlen(str.data);
|
||||
return ::wxDoCmp(m_impl.data(), m_impl.length(), str.data, str.len);
|
||||
}
|
||||
|
||||
int wxString::compare(size_t nStart, size_t nLen,
|
||||
const char* sz, size_t nCount) const
|
||||
{
|
||||
wxASSERT(nStart <= length());
|
||||
size_type strLen = length() - nStart;
|
||||
nLen = strLen < nLen ? strLen : nLen;
|
||||
|
||||
size_t pos, len;
|
||||
PosLenToImpl(nStart, nLen, &pos, &len);
|
||||
|
||||
SubstrBufFromMB str(ImplStr(sz, nCount));
|
||||
if ( str.len == npos )
|
||||
str.len = wxStringStrlen(str.data);
|
||||
|
||||
return ::wxDoCmp(m_impl.data() + pos, len, str.data, str.len);
|
||||
}
|
||||
|
||||
int wxString::compare(size_t nStart, size_t nLen,
|
||||
const wchar_t* sz, size_t nCount) const
|
||||
{
|
||||
wxASSERT(nStart <= length());
|
||||
size_type strLen = length() - nStart;
|
||||
nLen = strLen < nLen ? strLen : nLen;
|
||||
|
||||
size_t pos, len;
|
||||
PosLenToImpl(nStart, nLen, &pos, &len);
|
||||
|
||||
SubstrBufFromWC str(ImplStr(sz, nCount));
|
||||
if ( str.len == npos )
|
||||
str.len = wxStringStrlen(str.data);
|
||||
|
||||
return ::wxDoCmp(m_impl.data() + pos, len, str.data, str.len);
|
||||
}
|
||||
|
||||
#endif // wxUSE_STL_BASED_WXSTRING/!wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// find_{first,last}_[not]_of functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if !wxUSE_STL_BASED_WXSTRING || wxUSE_UNICODE_UTF8
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
|
||||
// NB: All these functions are implemented with the argument always being
|
||||
// wchar_t*, even in UTF-8 build in which the native string representation
|
||||
|
|
@ -998,7 +849,7 @@ size_t wxString::find_last_not_of(const char* sz, size_t nStart,
|
|||
size_t n) const
|
||||
{ return find_last_not_of(wxConvLibc.cMB2WC(sz, n, nullptr), nStart, n); }
|
||||
|
||||
#endif // !wxUSE_STL_BASED_WXSTRING || wxUSE_UNICODE_UTF8
|
||||
#endif // wxUSE_UNICODE_UTF8
|
||||
|
||||
// ===========================================================================
|
||||
// other common string functions
|
||||
|
|
@ -1830,11 +1681,7 @@ wxString wxString::FromCDouble(double val, int precision)
|
|||
|
||||
#if !wxUSE_UTF8_LOCALE_ONLY
|
||||
/* static */
|
||||
#ifdef wxNEEDS_WXSTRING_PRINTF_MIXIN
|
||||
wxString wxStringPrintfMixinBase::DoFormatWchar(const wxChar *format, ...)
|
||||
#else
|
||||
wxString wxString::DoFormatWchar(const wxChar *format, ...)
|
||||
#endif
|
||||
{
|
||||
va_list argptr;
|
||||
va_start(argptr, format);
|
||||
|
|
@ -1873,25 +1720,12 @@ wxString wxString::FormatV(const wxString& format, va_list argptr)
|
|||
}
|
||||
|
||||
#if !wxUSE_UTF8_LOCALE_ONLY
|
||||
#ifdef wxNEEDS_WXSTRING_PRINTF_MIXIN
|
||||
int wxStringPrintfMixinBase::DoPrintfWchar(const wxChar *format, ...)
|
||||
#else
|
||||
int wxString::DoPrintfWchar(const wxChar *format, ...)
|
||||
#endif
|
||||
{
|
||||
va_list argptr;
|
||||
va_start(argptr, format);
|
||||
|
||||
#ifdef wxNEEDS_WXSTRING_PRINTF_MIXIN
|
||||
// get a pointer to the wxString instance; we have to use dynamic_cast<>
|
||||
// because it's the only cast that works safely for downcasting when
|
||||
// multiple inheritance is used:
|
||||
wxString *str = static_cast<wxString*>(this);
|
||||
#else
|
||||
wxString *str = this;
|
||||
#endif
|
||||
|
||||
int iLen = str->PrintfV(format, argptr);
|
||||
int iLen = PrintfV(format, argptr);
|
||||
|
||||
va_end(argptr);
|
||||
|
||||
|
|
@ -2044,11 +1878,7 @@ static int DoStringPrintfV(wxString& str,
|
|||
int wxString::PrintfV(const wxString& format, va_list argptr)
|
||||
{
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
#if wxUSE_STL_BASED_WXSTRING
|
||||
typedef wxStringTypeBuffer<char> Utf8Buffer;
|
||||
#else
|
||||
typedef wxStringInternalBuffer Utf8Buffer;
|
||||
#endif
|
||||
typedef wxStringTypeBuffer<char> Utf8Buffer;
|
||||
#endif
|
||||
|
||||
#if wxUSE_UTF8_LOCALE_ONLY
|
||||
|
|
|
|||
|
|
@ -1,791 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/common/stringimpl.cpp
|
||||
// Purpose: wxString class
|
||||
// Author: Vadim Zeitlin, Ryan Norton
|
||||
// Modified by:
|
||||
// Created: 29/01/98
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// (c) 2004 Ryan Norton <wxprojects@comcast.net>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* About ref counting:
|
||||
* 1) all empty strings use g_strEmpty, nRefs = -1 (set in Init())
|
||||
* 2) AllocBuffer() sets nRefs to 1, Lock() increments it by one
|
||||
* 3) Unlock() decrements nRefs and frees memory if it goes to 0
|
||||
*/
|
||||
|
||||
// ===========================================================================
|
||||
// headers, declarations, constants
|
||||
// ===========================================================================
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/stringimpl.h"
|
||||
#include "wx/wxcrt.h"
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// static class variables definition
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
//According to STL _must_ be a -1 size_t
|
||||
const size_t wxStringImpl::npos = (size_t) -1;
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// static data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
// FIXME-UTF8: get rid of this, have only one wxEmptyString
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyStringImpl = "";
|
||||
#endif
|
||||
const wxChar WXDLLIMPEXP_BASE *wxEmptyString = wxT("");
|
||||
|
||||
#else
|
||||
|
||||
// allocating extra space for each string consumes more memory but speeds up
|
||||
// the concatenation operations (nLen is the current string's length)
|
||||
// NB: EXTRA_ALLOC must be >= 0!
|
||||
#define EXTRA_ALLOC (19 - nLen % 16)
|
||||
|
||||
// string handling functions used by wxString:
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
#define wxStringMemcpy memcpy
|
||||
#define wxStringMemcmp memcmp
|
||||
#define wxStringMemchr memchr
|
||||
#else
|
||||
#define wxStringMemcpy wxTmemcpy
|
||||
#define wxStringMemcmp wxTmemcmp
|
||||
#define wxStringMemchr wxTmemchr
|
||||
#endif
|
||||
|
||||
// for an empty string, GetStringData() will return this address: this
|
||||
// structure has the same layout as wxStringData and it's data() method will
|
||||
// return the empty string (dummy pointer)
|
||||
static const struct
|
||||
{
|
||||
wxStringData data;
|
||||
wxStringCharType dummy;
|
||||
} g_strEmpty = { {-1, 0, 0}, wxT('\0') };
|
||||
|
||||
// empty C style string: points to 'string data' byte of g_strEmpty
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
// FIXME-UTF8: get rid of this, have only one wxEmptyString
|
||||
const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyStringImpl = &g_strEmpty.dummy;
|
||||
const wxChar WXDLLIMPEXP_BASE *wxEmptyString = wxT("");
|
||||
#else
|
||||
const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyString = &g_strEmpty.dummy;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if !wxUSE_STL_BASED_WXSTRING
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this small class is used to gather statistics for performance tuning
|
||||
|
||||
// uncomment this to enable gathering of some statistics about wxString
|
||||
// efficiency
|
||||
//#define WXSTRING_STATISTICS
|
||||
|
||||
#ifdef WXSTRING_STATISTICS
|
||||
class Averager
|
||||
{
|
||||
public:
|
||||
Averager(const wxStringCharType *sz) { m_sz = sz; m_nTotal = m_nCount = 0; }
|
||||
~Averager()
|
||||
{
|
||||
wxPrintf("wxString %s: total = %lu, average = %f\n",
|
||||
m_sz, m_nTotal, ((float)m_nTotal)/m_nCount);
|
||||
}
|
||||
|
||||
void Add(size_t n) { m_nTotal += n; m_nCount++; }
|
||||
|
||||
private:
|
||||
unsigned long m_nCount, m_nTotal;
|
||||
const wxStringCharType *m_sz;
|
||||
} g_averageLength("allocation size"),
|
||||
g_averageSummandLength("summand length"),
|
||||
g_averageConcatHit("hit probability in concat"),
|
||||
g_averageInitialLength("initial string length");
|
||||
|
||||
#define STATISTICS_ADD(av, val) g_average##av.Add(val)
|
||||
#else
|
||||
#define STATISTICS_ADD(av, val)
|
||||
#endif // WXSTRING_STATISTICS
|
||||
|
||||
// ===========================================================================
|
||||
// wxStringData class deallocation
|
||||
// ===========================================================================
|
||||
|
||||
#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL)
|
||||
# pragma message (__FILE__ ": building with Multithreaded non DLL runtime has a performance impact on wxString!")
|
||||
void wxStringData::Free()
|
||||
{
|
||||
free(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
// ===========================================================================
|
||||
// wxStringImpl
|
||||
// ===========================================================================
|
||||
|
||||
// takes nLength elements of psz starting at nPos
|
||||
void wxStringImpl::InitWith(const wxStringCharType *psz,
|
||||
size_t nPos, size_t nLength)
|
||||
{
|
||||
Init();
|
||||
|
||||
// if the length is not given, assume the string to be NUL terminated
|
||||
if ( nLength == npos ) {
|
||||
wxASSERT_MSG( nPos <= wxStrlen(psz), wxT("index out of bounds") );
|
||||
|
||||
nLength = wxStrlen(psz + nPos);
|
||||
}
|
||||
|
||||
STATISTICS_ADD(InitialLength, nLength);
|
||||
|
||||
if ( nLength > 0 ) {
|
||||
// trailing '\0' is written in AllocBuffer()
|
||||
if ( !AllocBuffer(nLength) ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxStringImpl::InitWith") );
|
||||
return;
|
||||
}
|
||||
wxStringMemcpy(m_pchData, psz + nPos, nLength);
|
||||
}
|
||||
}
|
||||
|
||||
wxStringImpl::wxStringImpl(const_iterator first, const_iterator last)
|
||||
{
|
||||
if ( last >= first )
|
||||
{
|
||||
InitWith(first.GetPtr(), 0, last - first);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxFAIL_MSG( wxT("first must be before last") );
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
wxStringImpl::wxStringImpl(size_type n, wxStringCharType ch)
|
||||
{
|
||||
Init();
|
||||
append(n, ch);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// memory allocation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// allocates memory needed to store a C string of length nLen
|
||||
bool wxStringImpl::AllocBuffer(size_t nLen)
|
||||
{
|
||||
// allocating 0 sized buffer doesn't make sense, all empty strings should
|
||||
// reuse g_strEmpty
|
||||
wxASSERT( nLen > 0 );
|
||||
|
||||
// make sure that we don't overflow
|
||||
wxCHECK( nLen < (INT_MAX / sizeof(wxStringCharType)) -
|
||||
(sizeof(wxStringData) + EXTRA_ALLOC + 1), false );
|
||||
|
||||
STATISTICS_ADD(Length, nLen);
|
||||
|
||||
// allocate memory:
|
||||
// 1) one extra character for '\0' termination
|
||||
// 2) sizeof(wxStringData) for housekeeping info
|
||||
wxStringData* pData = (wxStringData*)
|
||||
malloc(sizeof(wxStringData) + (nLen + EXTRA_ALLOC + 1)*sizeof(wxStringCharType));
|
||||
|
||||
if ( pData == nullptr ) {
|
||||
// allocation failures are handled by the caller
|
||||
return false;
|
||||
}
|
||||
|
||||
pData->nRefs = 1;
|
||||
pData->nDataLength = nLen;
|
||||
pData->nAllocLength = nLen + EXTRA_ALLOC;
|
||||
m_pchData = pData->data(); // data starts after wxStringData
|
||||
m_pchData[nLen] = wxT('\0');
|
||||
return true;
|
||||
}
|
||||
|
||||
// must be called before changing this string
|
||||
bool wxStringImpl::CopyBeforeWrite()
|
||||
{
|
||||
wxStringData* pData = GetStringData();
|
||||
|
||||
if ( pData->IsShared() ) {
|
||||
pData->Unlock(); // memory not freed because shared
|
||||
size_t nLen = pData->nDataLength;
|
||||
if ( !AllocBuffer(nLen) ) {
|
||||
// allocation failures are handled by the caller
|
||||
return false;
|
||||
}
|
||||
wxStringMemcpy(m_pchData, pData->data(), nLen);
|
||||
}
|
||||
|
||||
wxASSERT( !GetStringData()->IsShared() ); // we must be the only owner
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// must be called before replacing contents of this string
|
||||
bool wxStringImpl::AllocBeforeWrite(size_t nLen)
|
||||
{
|
||||
wxASSERT( nLen != 0 ); // doesn't make any sense
|
||||
|
||||
// must not share string and must have enough space
|
||||
wxStringData* pData = GetStringData();
|
||||
if ( pData->IsShared() || pData->IsEmpty() ) {
|
||||
// can't work with old buffer, get new one
|
||||
pData->Unlock();
|
||||
if ( !AllocBuffer(nLen) ) {
|
||||
// allocation failures are handled by the caller
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( nLen > pData->nAllocLength ) {
|
||||
// realloc the buffer instead of calling malloc() again, this is more
|
||||
// efficient
|
||||
STATISTICS_ADD(Length, nLen);
|
||||
|
||||
nLen += EXTRA_ALLOC;
|
||||
|
||||
pData = (wxStringData*)
|
||||
realloc(pData,
|
||||
sizeof(wxStringData) + (nLen + 1)*sizeof(wxStringCharType));
|
||||
|
||||
if ( pData == nullptr ) {
|
||||
// allocation failures are handled by the caller
|
||||
// keep previous data since reallocation failed
|
||||
return false;
|
||||
}
|
||||
|
||||
pData->nAllocLength = nLen;
|
||||
m_pchData = pData->data();
|
||||
}
|
||||
}
|
||||
|
||||
wxASSERT( !GetStringData()->IsShared() ); // we must be the only owner
|
||||
|
||||
// it doesn't really matter what the string length is as it's going to be
|
||||
// overwritten later but, for extra safety, set it to 0 for now as we may
|
||||
// have some junk in m_pchData
|
||||
GetStringData()->nDataLength = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxStringImpl& wxStringImpl::append(size_t n, wxStringCharType ch)
|
||||
{
|
||||
size_type len = length();
|
||||
|
||||
if ( !Alloc(len + n) || !CopyBeforeWrite() ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxStringImpl::append") );
|
||||
return *this;
|
||||
}
|
||||
GetStringData()->nDataLength = len + n;
|
||||
m_pchData[len + n] = '\0';
|
||||
for ( size_t i = 0; i < n; ++i )
|
||||
m_pchData[len + i] = ch;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxStringImpl::resize(size_t nSize, wxStringCharType ch)
|
||||
{
|
||||
size_t len = length();
|
||||
|
||||
if ( nSize < len )
|
||||
{
|
||||
erase(begin() + nSize, end());
|
||||
}
|
||||
else if ( nSize > len )
|
||||
{
|
||||
append(nSize - len, ch);
|
||||
}
|
||||
//else: we have exactly the specified length, nothing to do
|
||||
}
|
||||
|
||||
// allocate enough memory for nLen characters
|
||||
bool wxStringImpl::Alloc(size_t nLen)
|
||||
{
|
||||
wxStringData *pData = GetStringData();
|
||||
if ( pData->nAllocLength <= nLen ) {
|
||||
if ( pData->IsEmpty() ) {
|
||||
STATISTICS_ADD(Length, nLen);
|
||||
|
||||
nLen += EXTRA_ALLOC;
|
||||
|
||||
pData = (wxStringData *)
|
||||
malloc(sizeof(wxStringData) + (nLen + 1)*sizeof(wxStringCharType));
|
||||
|
||||
if ( pData == nullptr ) {
|
||||
// allocation failure handled by caller
|
||||
return false;
|
||||
}
|
||||
|
||||
pData->nRefs = 1;
|
||||
pData->nDataLength = 0;
|
||||
pData->nAllocLength = nLen;
|
||||
m_pchData = pData->data(); // data starts after wxStringData
|
||||
m_pchData[0u] = wxT('\0');
|
||||
}
|
||||
else if ( pData->IsShared() ) {
|
||||
pData->Unlock(); // memory not freed because shared
|
||||
size_t nOldLen = pData->nDataLength;
|
||||
if ( !AllocBuffer(nLen) ) {
|
||||
// allocation failure handled by caller
|
||||
return false;
|
||||
}
|
||||
// +1 to copy the terminator, too
|
||||
memcpy(m_pchData, pData->data(), (nOldLen+1)*sizeof(wxStringCharType));
|
||||
GetStringData()->nDataLength = nOldLen;
|
||||
}
|
||||
else {
|
||||
nLen += EXTRA_ALLOC;
|
||||
|
||||
pData = (wxStringData *)
|
||||
realloc(pData, sizeof(wxStringData) + (nLen + 1)*sizeof(wxStringCharType));
|
||||
|
||||
if ( pData == nullptr ) {
|
||||
// allocation failure handled by caller
|
||||
// keep previous data since reallocation failed
|
||||
return false;
|
||||
}
|
||||
|
||||
// it's not important if the pointer changed or not (the check for this
|
||||
// is not faster than assigning to m_pchData in all cases)
|
||||
pData->nAllocLength = nLen;
|
||||
m_pchData = pData->data();
|
||||
}
|
||||
}
|
||||
//else: we've already got enough
|
||||
return true;
|
||||
}
|
||||
|
||||
wxStringImpl::iterator wxStringImpl::begin()
|
||||
{
|
||||
if ( !empty() )
|
||||
CopyBeforeWrite();
|
||||
return m_pchData;
|
||||
}
|
||||
|
||||
wxStringImpl::iterator wxStringImpl::end()
|
||||
{
|
||||
if ( !empty() )
|
||||
CopyBeforeWrite();
|
||||
return m_pchData + length();
|
||||
}
|
||||
|
||||
wxStringImpl::iterator wxStringImpl::erase(iterator it)
|
||||
{
|
||||
size_type idx = it - begin();
|
||||
erase(idx, 1);
|
||||
return begin() + idx;
|
||||
}
|
||||
|
||||
wxStringImpl& wxStringImpl::erase(size_t nStart, size_t nLen)
|
||||
{
|
||||
wxASSERT(nStart <= length());
|
||||
size_t strLen = length() - nStart;
|
||||
// delete nLen or up to the end of the string characters
|
||||
nLen = strLen < nLen ? strLen : nLen;
|
||||
wxStringImpl strTmp(c_str(), nStart);
|
||||
strTmp.append(c_str() + nStart + nLen, length() - nStart - nLen);
|
||||
|
||||
swap(strTmp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxStringImpl& wxStringImpl::insert(size_t nPos,
|
||||
const wxStringCharType *sz, size_t n)
|
||||
{
|
||||
wxASSERT( nPos <= length() );
|
||||
|
||||
if ( n == npos ) n = wxStrlen(sz);
|
||||
if ( n == 0 ) return *this;
|
||||
|
||||
if ( !Alloc(length() + n) || !CopyBeforeWrite() ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxStringImpl::insert") );
|
||||
return *this;
|
||||
}
|
||||
|
||||
memmove(m_pchData + nPos + n, m_pchData + nPos,
|
||||
(length() - nPos) * sizeof(wxStringCharType));
|
||||
memcpy(m_pchData + nPos, sz, n * sizeof(wxStringCharType));
|
||||
GetStringData()->nDataLength = length() + n;
|
||||
m_pchData[length()] = '\0';
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxStringImpl::swap(wxStringImpl& str)
|
||||
{
|
||||
wxStringCharType* tmp = str.m_pchData;
|
||||
str.m_pchData = m_pchData;
|
||||
m_pchData = tmp;
|
||||
}
|
||||
|
||||
size_t wxStringImpl::find(const wxStringImpl& str, size_t nStart) const
|
||||
{
|
||||
// deal with the special case of empty string first
|
||||
const size_t nLen = length();
|
||||
const size_t nLenOther = str.length();
|
||||
|
||||
if ( !nLenOther )
|
||||
{
|
||||
// empty string is a substring of anything
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( !nLen )
|
||||
{
|
||||
// the other string is non empty so can't be our substring
|
||||
return npos;
|
||||
}
|
||||
|
||||
wxASSERT( str.GetStringData()->IsValid() );
|
||||
wxASSERT( nStart <= nLen );
|
||||
|
||||
const wxStringCharType * const other = str.c_str();
|
||||
|
||||
// anchor
|
||||
const wxStringCharType* p =
|
||||
(const wxStringCharType*)wxStringMemchr(c_str() + nStart,
|
||||
*other,
|
||||
nLen - nStart);
|
||||
|
||||
if ( !p )
|
||||
return npos;
|
||||
|
||||
while ( p - c_str() + nLenOther <= nLen &&
|
||||
wxStringMemcmp(p, other, nLenOther) )
|
||||
{
|
||||
p++;
|
||||
|
||||
// anchor again
|
||||
p = (const wxStringCharType*)
|
||||
wxStringMemchr(p, *other, nLen - (p - c_str()));
|
||||
|
||||
if ( !p )
|
||||
return npos;
|
||||
}
|
||||
|
||||
return p - c_str() + nLenOther <= nLen ? p - c_str() : npos;
|
||||
}
|
||||
|
||||
size_t wxStringImpl::find(const wxStringCharType* sz,
|
||||
size_t nStart, size_t n) const
|
||||
{
|
||||
return find(wxStringImpl(sz, n), nStart);
|
||||
}
|
||||
|
||||
size_t wxStringImpl::find(wxStringCharType ch, size_t nStart) const
|
||||
{
|
||||
wxASSERT( nStart <= length() );
|
||||
|
||||
const wxStringCharType *p = (const wxStringCharType*)
|
||||
wxStringMemchr(c_str() + nStart, ch, length() - nStart);
|
||||
|
||||
return p == nullptr ? npos : p - c_str();
|
||||
}
|
||||
|
||||
size_t wxStringImpl::rfind(const wxStringImpl& str, size_t nStart) const
|
||||
{
|
||||
wxASSERT( str.GetStringData()->IsValid() );
|
||||
wxASSERT( nStart == npos || nStart <= length() );
|
||||
|
||||
if ( length() >= str.length() )
|
||||
{
|
||||
// avoids a corner case later
|
||||
if ( empty() && str.empty() )
|
||||
return 0;
|
||||
|
||||
// "top" is the point where search starts from
|
||||
size_t top = length() - str.length();
|
||||
|
||||
if ( nStart == npos )
|
||||
nStart = length() - 1;
|
||||
if ( nStart < top )
|
||||
top = nStart;
|
||||
|
||||
const wxStringCharType *cursor = c_str() + top;
|
||||
do
|
||||
{
|
||||
if ( wxStringMemcmp(cursor, str.c_str(), str.length()) == 0 )
|
||||
{
|
||||
return cursor - c_str();
|
||||
}
|
||||
} while ( cursor-- > c_str() );
|
||||
}
|
||||
|
||||
return npos;
|
||||
}
|
||||
|
||||
size_t wxStringImpl::rfind(const wxStringCharType* sz,
|
||||
size_t nStart, size_t n) const
|
||||
{
|
||||
return rfind(wxStringImpl(sz, n), nStart);
|
||||
}
|
||||
|
||||
size_t wxStringImpl::rfind(wxStringCharType ch, size_t nStart) const
|
||||
{
|
||||
if ( nStart == npos )
|
||||
{
|
||||
nStart = length();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxASSERT( nStart <= length() );
|
||||
}
|
||||
|
||||
const wxStringCharType *actual;
|
||||
for ( actual = c_str() + ( nStart == npos ? length() : nStart + 1 );
|
||||
actual > c_str(); --actual )
|
||||
{
|
||||
if ( *(actual - 1) == ch )
|
||||
return (actual - 1) - c_str();
|
||||
}
|
||||
|
||||
return npos;
|
||||
}
|
||||
|
||||
wxStringImpl& wxStringImpl::replace(size_t nStart, size_t nLen,
|
||||
const wxStringCharType *sz, size_t nCount)
|
||||
{
|
||||
// check and adjust parameters
|
||||
const size_t lenOld = length();
|
||||
|
||||
wxASSERT_MSG( nStart <= lenOld,
|
||||
wxT("index out of bounds in wxStringImpl::replace") );
|
||||
size_t nEnd = nStart + nLen;
|
||||
if ( nLen > lenOld - nStart )
|
||||
{
|
||||
// nLen may be out of range, as it can be npos, just clump it down
|
||||
nLen = lenOld - nStart;
|
||||
nEnd = lenOld;
|
||||
}
|
||||
|
||||
if ( nCount == npos )
|
||||
nCount = wxStrlen(sz);
|
||||
|
||||
// build the new string from 3 pieces: part of this string before nStart,
|
||||
// the new substring and the part of this string after nStart+nLen
|
||||
wxStringImpl tmp;
|
||||
const size_t lenNew = lenOld + nCount - nLen;
|
||||
if ( lenNew )
|
||||
{
|
||||
tmp.AllocBuffer(lenOld + nCount - nLen);
|
||||
|
||||
wxStringCharType *dst = tmp.m_pchData;
|
||||
memcpy(dst, m_pchData, nStart*sizeof(wxStringCharType));
|
||||
dst += nStart;
|
||||
|
||||
memcpy(dst, sz, nCount*sizeof(wxStringCharType));
|
||||
dst += nCount;
|
||||
|
||||
memcpy(dst, m_pchData + nEnd, (lenOld - nEnd)*sizeof(wxStringCharType));
|
||||
}
|
||||
|
||||
// and replace this string contents with the new one
|
||||
swap(tmp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxStringImpl wxStringImpl::substr(size_t nStart, size_t nLen) const
|
||||
{
|
||||
if ( nLen == npos )
|
||||
nLen = length() - nStart;
|
||||
return wxStringImpl(*this, nStart, nLen);
|
||||
}
|
||||
|
||||
// assigns one string to another
|
||||
wxStringImpl& wxStringImpl::operator=(const wxStringImpl& stringSrc)
|
||||
{
|
||||
wxASSERT( stringSrc.GetStringData()->IsValid() );
|
||||
|
||||
// don't copy string over itself
|
||||
if ( m_pchData != stringSrc.m_pchData ) {
|
||||
if ( stringSrc.GetStringData()->IsEmpty() ) {
|
||||
Reinit();
|
||||
}
|
||||
else {
|
||||
// adjust references
|
||||
GetStringData()->Unlock();
|
||||
m_pchData = stringSrc.m_pchData;
|
||||
GetStringData()->Lock();
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// assigns a single character
|
||||
wxStringImpl& wxStringImpl::operator=(wxStringCharType ch)
|
||||
{
|
||||
wxStringCharType c(ch);
|
||||
if ( !AssignCopy(1, &c) ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxStringImpl::operator=(wxStringCharType)") );
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// assigns C string
|
||||
wxStringImpl& wxStringImpl::operator=(const wxStringCharType *psz)
|
||||
{
|
||||
if ( !AssignCopy(wxStrlen(psz), psz) ) {
|
||||
wxFAIL_MSG( wxT("out of memory in wxStringImpl::operator=(const wxStringCharType *)") );
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// helper function: does real copy
|
||||
bool wxStringImpl::AssignCopy(size_t nSrcLen,
|
||||
const wxStringCharType *pszSrcData)
|
||||
{
|
||||
if ( nSrcLen == 0 ) {
|
||||
Reinit();
|
||||
}
|
||||
else {
|
||||
if ( !AllocBeforeWrite(nSrcLen) ) {
|
||||
// allocation failure handled by caller
|
||||
return false;
|
||||
}
|
||||
|
||||
// use memmove() and not memcpy() here as we might be copying from our own
|
||||
// buffer in case of assignment such as "s = s.c_str()" (see #11294)
|
||||
memmove(m_pchData, pszSrcData, nSrcLen*sizeof(wxStringCharType));
|
||||
|
||||
GetStringData()->nDataLength = nSrcLen;
|
||||
m_pchData[nSrcLen] = wxT('\0');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// string concatenation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// add something to this string
|
||||
bool wxStringImpl::ConcatSelf(size_t nSrcLen,
|
||||
const wxStringCharType *pszSrcData,
|
||||
size_t nMaxLen)
|
||||
{
|
||||
STATISTICS_ADD(SummandLength, nSrcLen);
|
||||
|
||||
nSrcLen = nSrcLen < nMaxLen ? nSrcLen : nMaxLen;
|
||||
|
||||
// concatenating an empty string is a NOP
|
||||
if ( nSrcLen > 0 ) {
|
||||
wxStringData *pData = GetStringData();
|
||||
size_t nLen = pData->nDataLength;
|
||||
|
||||
// take special care when appending part of this string to itself: the code
|
||||
// below reallocates our buffer and this invalidates pszSrcData pointer so
|
||||
// we have to copy it in another temporary string in this case (but avoid
|
||||
// doing this unnecessarily)
|
||||
if ( pszSrcData >= m_pchData && pszSrcData < m_pchData + nLen )
|
||||
{
|
||||
wxStringImpl tmp(pszSrcData, nSrcLen);
|
||||
return ConcatSelf(nSrcLen, tmp.m_pchData, nSrcLen);
|
||||
}
|
||||
|
||||
size_t nNewLen = nLen + nSrcLen;
|
||||
|
||||
// alloc new buffer if current is too small
|
||||
if ( pData->IsShared() ) {
|
||||
STATISTICS_ADD(ConcatHit, 0);
|
||||
|
||||
// we have to allocate another buffer
|
||||
wxStringData* pOldData = GetStringData();
|
||||
if ( !AllocBuffer(nNewLen) ) {
|
||||
// allocation failure handled by caller
|
||||
return false;
|
||||
}
|
||||
memcpy(m_pchData, pOldData->data(), nLen*sizeof(wxStringCharType));
|
||||
pOldData->Unlock();
|
||||
}
|
||||
else if ( nNewLen > pData->nAllocLength ) {
|
||||
STATISTICS_ADD(ConcatHit, 0);
|
||||
|
||||
reserve(nNewLen);
|
||||
// we have to grow the buffer
|
||||
if ( capacity() < nNewLen ) {
|
||||
// allocation failure handled by caller
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
STATISTICS_ADD(ConcatHit, 1);
|
||||
|
||||
// the buffer is already big enough
|
||||
}
|
||||
|
||||
// should be enough space
|
||||
wxASSERT( nNewLen <= GetStringData()->nAllocLength );
|
||||
|
||||
// fast concatenation - all is done in our buffer
|
||||
memcpy(m_pchData + nLen, pszSrcData, nSrcLen*sizeof(wxStringCharType));
|
||||
|
||||
m_pchData[nNewLen] = wxT('\0'); // put terminating '\0'
|
||||
GetStringData()->nDataLength = nNewLen; // and fix the length
|
||||
}
|
||||
//else: the string to append was empty
|
||||
return true;
|
||||
}
|
||||
|
||||
// get the pointer to writable buffer of (at least) nLen bytes
|
||||
wxStringCharType *wxStringImpl::DoGetWriteBuf(size_t nLen)
|
||||
{
|
||||
if ( !AllocBeforeWrite(nLen) ) {
|
||||
// allocation failure handled by caller
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
wxASSERT( GetStringData()->nRefs == 1 );
|
||||
GetStringData()->Validate(false);
|
||||
|
||||
return m_pchData;
|
||||
}
|
||||
|
||||
// put string back in a reasonable state after GetWriteBuf
|
||||
void wxStringImpl::DoUngetWriteBuf()
|
||||
{
|
||||
DoUngetWriteBuf(wxStrlen(m_pchData));
|
||||
}
|
||||
|
||||
void wxStringImpl::DoUngetWriteBuf(size_t nLen)
|
||||
{
|
||||
wxStringData * const pData = GetStringData();
|
||||
|
||||
wxASSERT_MSG( nLen < pData->nAllocLength, wxT("buffer overrun") );
|
||||
|
||||
// the strings we store are always NUL-terminated
|
||||
pData->data()[nLen] = wxT('\0');
|
||||
pData->nDataLength = nLen;
|
||||
pData->Validate(true);
|
||||
}
|
||||
|
||||
#endif // !wxUSE_STL_BASED_WXSTRING
|
||||
|
|
@ -128,7 +128,7 @@ bool wxStringOperationsUtf8::IsValidUtf8String(const char *str, size_t len)
|
|||
return true; // empty string is UTF8 string
|
||||
|
||||
const unsigned char *c = (const unsigned char*)str;
|
||||
const unsigned char * const end = (len == wxStringImpl::npos) ? nullptr : c + len;
|
||||
const unsigned char * const end = (len == std::string::npos) ? nullptr : c + len;
|
||||
|
||||
for ( ; end != nullptr ? c != end : *c; ++c )
|
||||
{
|
||||
|
|
@ -285,7 +285,7 @@ wxUniChar::Utf8CharBuffer wxUniChar::AsUTF8() const
|
|||
}
|
||||
|
||||
wxUniChar
|
||||
wxStringOperationsUtf8::DecodeNonAsciiChar(wxStringImpl::const_iterator i)
|
||||
wxStringOperationsUtf8::DecodeNonAsciiChar(std::string::const_iterator i)
|
||||
{
|
||||
wxASSERT( IsValidUtf8LeadByte(*i) );
|
||||
|
||||
|
|
|
|||
|
|
@ -969,7 +969,6 @@ wxVariant::wxVariant(const wxScopedWCharBuffer& val, const wxString& name)
|
|||
m_name = name;
|
||||
}
|
||||
|
||||
#if wxUSE_STD_STRING
|
||||
wxVariant::wxVariant(const std::string& val, const wxString& name)
|
||||
{
|
||||
m_refData = new wxVariantDataString(wxString(val));
|
||||
|
|
@ -981,7 +980,6 @@ wxVariant::wxVariant(const std::wstring& val, const wxString& name)
|
|||
m_refData = new wxVariantDataString(wxString(val));
|
||||
m_name = name;
|
||||
}
|
||||
#endif // wxUSE_STD_STRING
|
||||
|
||||
bool wxVariant::operator== (const wxString& value) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -468,87 +468,56 @@ wxDbgHelpDLL::DumpUDT(wxPSYMBOL_INFO pSym, void *pVariable, unsigned level)
|
|||
s.reserve(512);
|
||||
s = GetSymbolName(pSym);
|
||||
|
||||
#if !wxUSE_STD_STRING
|
||||
// special handling for ubiquitous wxString: although the code below works
|
||||
// for it as well, it shows the wxStringBase class and takes 4 lines
|
||||
// instead of only one as this branch
|
||||
if ( s == wxT("wxString") )
|
||||
// Determine how many children this type has.
|
||||
DWORD dwChildrenCount = 0;
|
||||
DoGetTypeInfo(pSym, TI_GET_CHILDRENCOUNT, &dwChildrenCount);
|
||||
|
||||
// Prepare to get an array of "TypeIds", representing each of the children.
|
||||
TI_FINDCHILDREN_PARAMS *children = (TI_FINDCHILDREN_PARAMS *)
|
||||
malloc(sizeof(TI_FINDCHILDREN_PARAMS) +
|
||||
(dwChildrenCount - 1)*sizeof(ULONG));
|
||||
if ( !children )
|
||||
return s;
|
||||
|
||||
children->Count = dwChildrenCount;
|
||||
children->Start = 0;
|
||||
|
||||
// Get the array of TypeIds, one for each child type
|
||||
if ( !DoGetTypeInfo(pSym, TI_FINDCHILDREN, children) )
|
||||
{
|
||||
wxString *ps = (wxString *)pVariable;
|
||||
|
||||
// we can't just dump wxString directly as it could be corrupted or
|
||||
// invalid and it could also be locked for writing (i.e. if we're
|
||||
// between GetWriteBuf() and UngetWriteBuf() calls) and assert when we
|
||||
// try to access it contents using public methods, so instead use our
|
||||
// knowledge of its internals
|
||||
const wxChar *p = nullptr;
|
||||
if ( !::IsBadReadPtr(ps, sizeof(wxString)) )
|
||||
{
|
||||
p = ps->data();
|
||||
wxStringData *data = (wxStringData *)p - 1;
|
||||
if ( ::IsBadReadPtr(data, sizeof(wxStringData)) ||
|
||||
::IsBadReadPtr(p, sizeof(wxChar *)*data->nAllocLength) )
|
||||
{
|
||||
p = nullptr; // don't touch this pointer with 10 feet pole
|
||||
}
|
||||
}
|
||||
|
||||
s << wxT("(\"") << (p ? p : wxT("???")) << wxT(")\"");
|
||||
}
|
||||
else // any other UDT
|
||||
#endif // !wxUSE_STD_STRING
|
||||
{
|
||||
// Determine how many children this type has.
|
||||
DWORD dwChildrenCount = 0;
|
||||
DoGetTypeInfo(pSym, TI_GET_CHILDRENCOUNT, &dwChildrenCount);
|
||||
|
||||
// Prepare to get an array of "TypeIds", representing each of the children.
|
||||
TI_FINDCHILDREN_PARAMS *children = (TI_FINDCHILDREN_PARAMS *)
|
||||
malloc(sizeof(TI_FINDCHILDREN_PARAMS) +
|
||||
(dwChildrenCount - 1)*sizeof(ULONG));
|
||||
if ( !children )
|
||||
return s;
|
||||
|
||||
children->Count = dwChildrenCount;
|
||||
children->Start = 0;
|
||||
|
||||
// Get the array of TypeIds, one for each child type
|
||||
if ( !DoGetTypeInfo(pSym, TI_FINDCHILDREN, children) )
|
||||
{
|
||||
free(children);
|
||||
return s;
|
||||
}
|
||||
|
||||
s << wxT(" {\n");
|
||||
|
||||
// Iterate through all children
|
||||
wxSYMBOL_INFO sym;
|
||||
wxZeroMemory(sym);
|
||||
sym.ModBase = pSym->ModBase;
|
||||
for ( unsigned i = 0; i < dwChildrenCount; i++ )
|
||||
{
|
||||
sym.TypeIndex = children->ChildId[i];
|
||||
|
||||
// children here are in lexicographic sense, i.e. we get all our nested
|
||||
// classes and not only our member fields, but we can't get the values
|
||||
// for the members of the nested classes, of course!
|
||||
DWORD nested;
|
||||
if ( DoGetTypeInfo(&sym, TI_GET_NESTED, &nested) && nested )
|
||||
continue;
|
||||
|
||||
// avoid infinite recursion: this does seem to happen sometimes with
|
||||
// complex typedefs...
|
||||
if ( sym.TypeIndex == pSym->TypeIndex )
|
||||
continue;
|
||||
|
||||
s += DumpField(&sym, pVariable, level + 1);
|
||||
}
|
||||
|
||||
free(children);
|
||||
|
||||
s << wxString(wxT('\t'), level + 1) << wxT('}');
|
||||
return s;
|
||||
}
|
||||
|
||||
s << wxT(" {\n");
|
||||
|
||||
// Iterate through all children
|
||||
wxSYMBOL_INFO sym;
|
||||
wxZeroMemory(sym);
|
||||
sym.ModBase = pSym->ModBase;
|
||||
for ( unsigned i = 0; i < dwChildrenCount; i++ )
|
||||
{
|
||||
sym.TypeIndex = children->ChildId[i];
|
||||
|
||||
// children here are in lexicographic sense, i.e. we get all our nested
|
||||
// classes and not only our member fields, but we can't get the values
|
||||
// for the members of the nested classes, of course!
|
||||
DWORD nested;
|
||||
if ( DoGetTypeInfo(&sym, TI_GET_NESTED, &nested) && nested )
|
||||
continue;
|
||||
|
||||
// avoid infinite recursion: this does seem to happen sometimes with
|
||||
// complex typedefs...
|
||||
if ( sym.TypeIndex == pSym->TypeIndex )
|
||||
continue;
|
||||
|
||||
s += DumpField(&sym, pVariable, level + 1);
|
||||
}
|
||||
|
||||
free(children);
|
||||
|
||||
s << wxString(wxT('\t'), level + 1) << wxT('}');
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,12 +34,6 @@
|
|||
#include "wx/scopedarray.h"
|
||||
#include "wx/dcbuffer.h"
|
||||
|
||||
#if !wxUSE_STD_CONTAINERS && !wxUSE_STD_IOSTREAM && !wxUSE_STD_STRING
|
||||
#include "wx/beforestd.h"
|
||||
#include <string>
|
||||
#include "wx/afterstd.h"
|
||||
#endif
|
||||
|
||||
#include "ScintillaWX.h"
|
||||
#include "wx/stc/stc.h"
|
||||
#include "wx/stc/private.h"
|
||||
|
|
|
|||
|
|
@ -325,7 +325,6 @@
|
|||
#include <wx/strconv.h>
|
||||
#include <wx/stream.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/stringimpl.h>
|
||||
#include <wx/stringops.h>
|
||||
#include <wx/strvararg.h>
|
||||
#include <wx/sysopt.h>
|
||||
|
|
|
|||
|
|
@ -253,8 +253,6 @@ TEST_CASE("wxWindowList::Find", "[list]")
|
|||
CHECK( it == l.GetFirst() );
|
||||
}
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
|
||||
#include <list>
|
||||
|
||||
// Check that we convert wxList to std::list using the latter's ctor taking 2
|
||||
|
|
@ -275,5 +273,3 @@ TEST_CASE("wxList::iterator", "[list][std][iterator]")
|
|||
const wxListBazs cli;
|
||||
CHECK( std::list<Baz*>(cli.begin(), cli.end()).empty() );
|
||||
}
|
||||
|
||||
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
|
|
|
|||
|
|
@ -520,7 +520,6 @@ TEST_CASE("StdString::Substr", "[stdstring]")
|
|||
CHECK( s1.substr( 17, 30 ) == wxT("") );
|
||||
}
|
||||
|
||||
#if wxUSE_STD_STRING
|
||||
TEST_CASE("StdString::Conversion", "[stdstring]")
|
||||
{
|
||||
std::string strStd("std::string value");
|
||||
|
|
@ -575,7 +574,6 @@ TEST_CASE("StdString::Conversion", "[stdstring]")
|
|||
|
||||
CHECK( wxString("bye").utf8_string() == std::string("bye") );
|
||||
}
|
||||
#endif // wxUSE_STD_STRING
|
||||
|
||||
TEST_CASE("StdString::Algo", "[stdstring]")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ TEST_CASE("SizetPrintf", "[wxString][Printf][vararg]")
|
|||
== "size_t=0xA0" );
|
||||
}
|
||||
|
||||
#if wxUSE_STD_STRING
|
||||
TEST_CASE("StdString", "[wxString][Printf][vararg]")
|
||||
{
|
||||
// test passing std::[w]string
|
||||
|
|
@ -137,7 +136,6 @@ TEST_CASE("StdString", "[wxString][Printf][vararg]")
|
|||
s.Printf("string %s(%i).", wc, 2);
|
||||
CHECK( s == "string widechar(2)." );
|
||||
}
|
||||
#endif // wxUSE_STD_STRING
|
||||
|
||||
#if wxUSE_LONGLONG
|
||||
TEST_CASE("LongLongPrintf", "[wxString][Printf][vararg]")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue