- Revision
- 235473
- Author
- [email protected]
- Date
- 2018-08-29 12:24:39 -0700 (Wed, 29 Aug 2018)
Log Message
Rename wtf/text/mac/StringMac.mm to wtf/text/cococa/StringCococa.mm
<https://webkit.org/b/189082>
Reviewed by Sam Weinig.
Includes a drive-by fix for a webkit-style warning:
ERROR: Source/WTF/wtf/text/cocoa/StringCocoa.mm:34: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5]
* WTF.xcodeproj/project.pbxproj: Update for move and rename.
* wtf/PlatformMac.cmake: Add missing cocoa/StringCocoa.mm source
file. Drive-by fix for rename of
TextBreakIteratorInternalICUMac.mm to
TextBreakIteratorInternalICUCocoa.cpp.
* wtf/text/cocoa/StringCocoa.mm: Renamed from Source/WTF/wtf/text/mac/StringMac.mm.
(WTF::String::String):
Modified Paths
Added Paths
Removed Paths
- trunk/Source/WTF/wtf/text/mac/
Diff
Modified: trunk/Source/WTF/ChangeLog (235472 => 235473)
--- trunk/Source/WTF/ChangeLog 2018-08-29 19:17:45 UTC (rev 235472)
+++ trunk/Source/WTF/ChangeLog 2018-08-29 19:24:39 UTC (rev 235473)
@@ -1,3 +1,22 @@
+2018-08-29 David Kilzer <[email protected]>
+
+ Rename wtf/text/mac/StringMac.mm to wtf/text/cococa/StringCococa.mm
+ <https://webkit.org/b/189082>
+
+ Reviewed by Sam Weinig.
+
+ Includes a drive-by fix for a webkit-style warning:
+
+ ERROR: Source/WTF/wtf/text/cocoa/StringCocoa.mm:34: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5]
+
+ * WTF.xcodeproj/project.pbxproj: Update for move and rename.
+ * wtf/PlatformMac.cmake: Add missing cocoa/StringCocoa.mm source
+ file. Drive-by fix for rename of
+ TextBreakIteratorInternalICUMac.mm to
+ TextBreakIteratorInternalICUCocoa.cpp.
+ * wtf/text/cocoa/StringCocoa.mm: Renamed from Source/WTF/wtf/text/mac/StringMac.mm.
+ (WTF::String::String):
+
2018-08-27 Yusuke Suzuki <[email protected]>
[WebAssembly] Parse wasm modules in a streaming fashion
Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (235472 => 235473)
--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2018-08-29 19:17:45 UTC (rev 235472)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2018-08-29 19:24:39 UTC (rev 235473)
@@ -88,7 +88,7 @@
9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; };
A3B725EC987446AD93F1A440 /* RandomDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8F597CA2A57417FBAB92FD6 /* RandomDevice.cpp */; };
A3E4DD931F3A803400DED0B4 /* TextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3E4DD911F3A803400DED0B4 /* TextStream.cpp */; };
- A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; };
+ A5BA15F3182433A900A82E69 /* StringCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringCocoa.mm */; };
A5BA15F51824348000A82E69 /* StringImplCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplCocoa.mm */; };
A5BA15FA182435A600A82E69 /* AtomicStringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F7182435A600A82E69 /* AtomicStringImplCF.cpp */; };
A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F8182435A600A82E69 /* StringCF.cpp */; };
@@ -427,7 +427,7 @@
A5098AFF1C169E0700087797 /* SandboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxSPI.h; sourceTree = "<group>"; };
A5098B011C16A4F900087797 /* SecuritySPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecuritySPI.h; sourceTree = "<group>"; };
A561F30F1DF2642100FF675D /* DeprecatedOptional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedOptional.h; sourceTree = "<group>"; };
- A5BA15F2182433A900A82E69 /* StringMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringMac.mm; path = ../mac/StringMac.mm; sourceTree = "<group>"; };
+ A5BA15F2182433A900A82E69 /* StringCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringCocoa.mm; sourceTree = "<group>"; };
A5BA15F41824348000A82E69 /* StringImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringImplCocoa.mm; sourceTree = "<group>"; };
A5BA15F7182435A600A82E69 /* AtomicStringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtomicStringImplCF.cpp; sourceTree = "<group>"; };
A5BA15F8182435A600A82E69 /* StringCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringCF.cpp; sourceTree = "<group>"; };
@@ -776,8 +776,8 @@
A5BA15F11824339F00A82E69 /* cocoa */ = {
isa = PBXGroup;
children = (
+ A5BA15F2182433A900A82E69 /* StringCocoa.mm */,
A5BA15F41824348000A82E69 /* StringImplCocoa.mm */,
- A5BA15F2182433A900A82E69 /* StringMac.mm */,
93934BD218A1E8C300D0D6A1 /* StringViewCocoa.mm */,
1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp */,
);
@@ -1555,10 +1555,10 @@
A8A4743C151A825B004123FF /* StringBuilder.cpp in Sources */,
E38D6E271F5522E300A75CC4 /* StringBuilderJSON.cpp in Sources */,
A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */,
+ A5BA15F3182433A900A82E69 /* StringCocoa.mm in Sources */,
A8A47440151A825B004123FF /* StringImpl.cpp in Sources */,
A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */,
A5BA15F51824348000A82E69 /* StringImplCocoa.mm in Sources */,
- A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */,
0FDDBFA71666DFA300C55FEF /* StringPrintStream.cpp in Sources */,
93F1993E19D7958D00C2390B /* StringView.cpp in Sources */,
93934BD518A1F16900D0D6A1 /* StringViewCF.cpp in Sources */,
Modified: trunk/Source/WTF/wtf/PlatformMac.cmake (235472 => 235473)
--- trunk/Source/WTF/wtf/PlatformMac.cmake 2018-08-29 19:17:45 UTC (rev 235472)
+++ trunk/Source/WTF/wtf/PlatformMac.cmake 2018-08-29 19:24:39 UTC (rev 235473)
@@ -57,9 +57,10 @@
text/cf/StringImplCF.cpp
text/cf/StringViewCF.cpp
+ text/cocoa/StringCocoa.mm
text/cocoa/StringImplCocoa.mm
text/cocoa/StringViewCocoa.mm
- text/cocoa/TextBreakIteratorInternalICUMac.mm
+ text/cocoa/TextBreakIteratorInternalICUCocoa.cpp
)
list(APPEND WTF_PRIVATE_INCLUDE_DIRECTORIES
Copied: trunk/Source/WTF/wtf/text/cocoa/StringCocoa.mm (from rev 235472, trunk/Source/WTF/wtf/text/mac/StringMac.mm) (0 => 235473)
--- trunk/Source/WTF/wtf/text/cocoa/StringCocoa.mm (rev 0)
+++ trunk/Source/WTF/wtf/text/cocoa/StringCocoa.mm 2018-08-29 19:24:39 UTC (rev 235473)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2006-2018 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "WTFString.h"
+
+#include <CoreFoundation/CFString.h>
+
+namespace WTF {
+
+String::String(NSString *str)
+{
+ if (!str)
+ return;
+
+ CFIndex size = CFStringGetLength(reinterpret_cast<CFStringRef>(str));
+ if (!size)
+ m_impl = StringImpl::empty();
+ else {
+ Vector<LChar, 1024> lcharBuffer(size);
+ CFIndex usedBufLen;
+ CFIndex convertedsize = CFStringGetBytes(reinterpret_cast<CFStringRef>(str), CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen);
+ if ((convertedsize == size) && (usedBufLen == size)) {
+ m_impl = StringImpl::create(lcharBuffer.data(), size);
+ return;
+ }
+
+ Vector<UChar, 1024> ucharBuffer(size);
+ CFStringGetCharacters(reinterpret_cast<CFStringRef>(str), CFRangeMake(0, size), ucharBuffer.data());
+ m_impl = StringImpl::create(ucharBuffer.data(), size);
+ }
+}
+
+}