2006-08-29 Anders Carlsson <acarlsson@apple.com>
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2006 18:58:58 +0000 (18:58 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2006 18:58:58 +0000 (18:58 +0000)
        Reviewed by Darin and Geoff.

        Move the CF String functions to separate files in platform/cf.
        Also, move the files in platform/cfnet to platform/cf.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/PlatformString.h:
        * platform/StringImpl.h:
        * platform/cf/StringCF.cpp: Added.
        (WebCore::String::String):
        * platform/cf/StringImplCF.cpp: Added.
        (WebCore::StringImpl::createCFString):
        * platform/cfnet/KURLCFNet.cpp: Removed.
        * platform/cfnet/ResourceLoaderCFNet.cpp: Removed.
        * platform/mac/StringImplMac.mm:
        * platform/mac/StringMac.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/platform/PlatformString.h
WebCore/platform/StringImpl.h
WebCore/platform/cf/KURLCFNet.cpp [moved from WebCore/platform/cfnet/KURLCFNet.cpp with 100% similarity]
WebCore/platform/cf/ResourceLoaderCFNet.cpp [moved from WebCore/platform/cfnet/ResourceLoaderCFNet.cpp with 100% similarity]
WebCore/platform/cf/StringCF.cpp [new file with mode: 0644]
WebCore/platform/cf/StringImplCF.cpp [new file with mode: 0644]
WebCore/platform/mac/StringImplMac.mm
WebCore/platform/mac/StringMac.mm

index ef076b538045e3566c0755fbb47d5a9085f6bfbd..2192fdd97e24546101d834579a502a7fde2c32e8 100644 (file)
@@ -1,3 +1,22 @@
+2006-08-29  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Darin and Geoff.
+
+        Move the CF String functions to separate files in platform/cf.
+        Also, move the files in platform/cfnet to platform/cf.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/PlatformString.h:
+        * platform/StringImpl.h:
+        * platform/cf/StringCF.cpp: Added.
+        (WebCore::String::String):
+        * platform/cf/StringImplCF.cpp: Added.
+        (WebCore::StringImpl::createCFString):
+        * platform/cfnet/KURLCFNet.cpp: Removed.
+        * platform/cfnet/ResourceLoaderCFNet.cpp: Removed.
+        * platform/mac/StringImplMac.mm:
+        * platform/mac/StringMac.mm:
+
 2006-08-29  Geoffrey Garen  <ggaren@apple.com>
 
         Rolling out a change I included by accident in my last commit.
index 97f6d090518967d15d6a719262e9a69731019f90..0653c43898822085937a9b95656a0fbb1497c8fe 100644 (file)
                1AE2AEC80A1D297B00B42B25 /* JSHTMLQuoteElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE2AEC40A1D297B00B42B25 /* JSHTMLQuoteElement.h */; };
                1AE2AEE60A1D2A7500B42B25 /* JSHTMLBlockquoteElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE2AEE40A1D2A7500B42B25 /* JSHTMLBlockquoteElement.cpp */; };
                1AE2AEE70A1D2A7500B42B25 /* JSHTMLBlockquoteElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE2AEE50A1D2A7500B42B25 /* JSHTMLBlockquoteElement.h */; };
+               1AE42F6A0AA4B8CB00C8612D /* StringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE42F680AA4B8CB00C8612D /* StringCF.cpp */; };
+               1AE42F6B0AA4B8CB00C8612D /* StringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE42F690AA4B8CB00C8612D /* StringImplCF.cpp */; };
                1CAF34810A6C405200ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1CAF34820A6C405200ABE06E /* WebScriptObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CAF347F0A6C405200ABE06E /* WebScriptObject.mm */; };
                1CAF34830A6C405200ABE06E /* WebScriptObjectPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF34800A6C405200ABE06E /* WebScriptObjectPrivate.h */; };
                1AE2AEC40A1D297B00B42B25 /* JSHTMLQuoteElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLQuoteElement.h; sourceTree = "<group>"; };
                1AE2AEE40A1D2A7500B42B25 /* JSHTMLBlockquoteElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLBlockquoteElement.cpp; sourceTree = "<group>"; };
                1AE2AEE50A1D2A7500B42B25 /* JSHTMLBlockquoteElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLBlockquoteElement.h; sourceTree = "<group>"; };
+               1AE42F680AA4B8CB00C8612D /* StringCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StringCF.cpp; sourceTree = "<group>"; };
+               1AE42F690AA4B8CB00C8612D /* StringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StringImplCF.cpp; sourceTree = "<group>"; };
                1CAF347E0A6C405200ABE06E /* WebScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptObject.h; sourceTree = "<group>"; };
                1CAF347F0A6C405200ABE06E /* WebScriptObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptObject.mm; sourceTree = "<group>"; };
                1CAF34800A6C405200ABE06E /* WebScriptObjectPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptObjectPrivate.h; sourceTree = "<group>"; };
                        path = DerivedSources/WebCore;
                        sourceTree = BUILT_PRODUCTS_DIR;
                };
+               1AE42F670AA4B8CB00C8612D /* cf */ = {
+                       isa = PBXGroup;
+                       children = (
+                               1AE42F680AA4B8CB00C8612D /* StringCF.cpp */,
+                               1AE42F690AA4B8CB00C8612D /* StringImplCF.cpp */,
+                       );
+                       path = cf;
+                       sourceTree = "<group>";
+               };
                5126E6B60A2E3AEF005C29FA /* icon */ = {
                        isa = PBXGroup;
                        children = (
                BCF1A5BA097832090061A123 /* platform */ = {
                        isa = PBXGroup;
                        children = (
+                               1AE42F670AA4B8CB00C8612D /* cf */,
                                93032CCC09AEC36200F82A18 /* cg */,
                                6582A14809999D6C00BEEB6D /* mac */,
                                A85D7A8C0879EC64006A9172 /* AffineTransform.cpp */,
                                BC837C7B0A9D0D1A006B186A /* PDFDocumentImage.cpp in Sources */,
                                AA84FC850AA0FE08007699AF /* JSSVGMetadataElement.cpp in Sources */,
                                AAC8DAB10AA1002000DC0907 /* SVGMetadataElement.cpp in Sources */,
+                               1AE42F6A0AA4B8CB00C8612D /* StringCF.cpp in Sources */,
+                               1AE42F6B0AA4B8CB00C8612D /* StringImplCF.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 5b6bf60c7bef95896d2578bb31f4ee7dbb693e64..4080e683a5073ad893f8c8e1b35624e0771a6a9c 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "StringImpl.h"
 
-#if __APPLE__
+#if PLATFORM(CF)
 #include <CoreFoundation/CoreFoundation.h>
 #endif
 
@@ -134,7 +134,7 @@ public:
 
     StringImpl* impl() const { return m_impl.get(); }
 
-#if __APPLE__
+#if PLATFORM(CF)
     String(CFStringRef);
     CFStringRef createCFString() const { return m_impl ? m_impl->createCFString() : CFSTR(""); }
 #endif
index e4bcbd52020f8218cc44f296054a538d59810ca6..4ba382799d2ac5374f69571d66fbbdc592ba29dc 100644 (file)
@@ -32,7 +32,7 @@
 #include <unicode/umachine.h>
 #include <limits.h>
 
-#if __APPLE__
+#if PLATFORM(CF)
 #include <CoreFoundation/CoreFoundation.h>
 #endif
 
@@ -121,7 +121,7 @@ public:
 
     Vector<char> ascii() const;
 
-#if __APPLE__
+#if PLATFORM(CF)
     StringImpl(CFStringRef);
     CFStringRef createCFString() const;
 #endif
diff --git a/WebCore/platform/cf/StringCF.cpp b/WebCore/platform/cf/StringCF.cpp
new file mode 100644 (file)
index 0000000..e87d79c
--- /dev/null
@@ -0,0 +1,41 @@
+/**
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+String::String(CFStringRef str)
+{
+    if (!str)
+        return;
+
+    CFIndex size = CFStringGetLength(str);
+    if (size == 0)
+        m_impl = StringImpl::empty();
+    else {
+        Vector<UChar, 1024> buffer(size);
+        CFStringGetCharacters(str, CFRangeMake(0, size), buffer.data());
+        m_impl = new StringImpl(buffer.data(), size);
+    }
+}
+
+}
diff --git a/WebCore/platform/cf/StringImplCF.cpp b/WebCore/platform/cf/StringImplCF.cpp
new file mode 100644 (file)
index 0000000..d46eb36
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+#include "StringImpl.h"
+
+namespace WebCore {
+
+CFStringRef StringImpl::createCFString() const
+{
+    return CFStringCreateWithCharacters(NULL, m_data, m_length);
+}
+
+}
index 412940ca11f4018b8ef00c91837207c955e3c163..e22617eb7fe70adf87e4c4a7d475405857f82300 100644 (file)
 
 namespace WebCore {
 
-CFStringRef StringImpl::createCFString() const
-{
-    return CFStringCreateWithCharacters(NULL, m_data, m_length);
-}
-
 StringImpl::operator NSString *() const
 {
     return [NSString stringWithCharacters:m_data length:m_length];
index 60d101c20bf17da0668340c9d9360cb03479eea1..d735ef989ee7d696a691d6a4d7c8dd1e0fce77aa 100644 (file)
 
 namespace WebCore {
 
-String::String(CFStringRef str)
-{
-    if (!str)
-        return;
-
-    CFIndex size = CFStringGetLength(str);
-    if (size == 0)
-        m_impl = StringImpl::empty();
-    else {
-        Vector<UChar, 1024> buffer(size);
-        CFStringGetCharacters(str, CFRangeMake(0, size), buffer.data());
-        m_impl = new StringImpl(buffer.data(), size);
-    }
-}
-
 String::String(NSString* str)
 {
     if (!str)