Commit 98455478 authored by andersca's avatar andersca

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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9f74ac02
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.
......
......@@ -175,6 +175,8 @@
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 */; };
......@@ -1870,6 +1872,8 @@
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>"; };
......@@ -3850,6 +3854,15 @@
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 = (
......@@ -5210,6 +5223,7 @@
BCF1A5BA097832090061A123 /* platform */ = {
isa = PBXGroup;
children = (
1AE42F670AA4B8CB00C8612D /* cf */,
93032CCC09AEC36200F82A18 /* cg */,
6582A14809999D6C00BEEB6D /* mac */,
A85D7A8C0879EC64006A9172 /* AffineTransform.cpp */,
......@@ -7491,6 +7505,8 @@
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;
};
......
......@@ -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
......
......@@ -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
......
/**
* 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);
}
}
}
/**
* 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);
}
}
......@@ -23,11 +23,6 @@
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];
......
......@@ -23,21 +23,6 @@
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment