Remove wx own wxStringImpl implementation

Always use std::basic_string<> as wxStringImpl.

Closes #22883.
This commit is contained in:
Vadim Zeitlin
2022-11-17 00:40:50 +01:00
parent 222cf952f4
commit 2c0c727f49
21 changed files with 69 additions and 1613 deletions
-19
View File
@@ -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
-2
View File
@@ -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
-2
View File
@@ -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
-2
View File
@@ -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
-16
View File
@@ -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) $<
-16
View File
@@ -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
-2
View File
@@ -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" />
-6
View File
@@ -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 */,
+39 -158
View File
@@ -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
// ---------------------------------------------------------------------------
File diff suppressed because it is too large Load Diff
+8 -5
View File
@@ -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
+6 -14
View File
@@ -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)
+7 -8
View File
@@ -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
+2 -2
View File
@@ -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; }
-3
View File
@@ -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
+5
View File
@@ -79,6 +79,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;
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -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) );
-1
View File
@@ -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>