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
+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.
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;
};
#include "StringImpl.h"
-#if __APPLE__
+#if PLATFORM(CF)
#include <CoreFoundation/CoreFoundation.h>
#endif
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
#include <unicode/umachine.h>
#include <limits.h>
-#if __APPLE__
+#if PLATFORM(CF)
#include <CoreFoundation/CoreFoundation.h>
#endif
Vector<char> ascii() const;
-#if __APPLE__
+#if PLATFORM(CF)
StringImpl(CFStringRef);
CFStringRef createCFString() const;
#endif
--- /dev/null
+/**
+ * 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);
+ }
+}
+
+}
--- /dev/null
+/**
+ * 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);
+}
+
+}
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];
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)