Reviewed by Sam and Steve.
- Added convenience methods for converting between BSTR and JSStringRefs
* API/JSStringRefCOM.cpp: Added.
(JSStringCreateWithCFString):
(JSStringCopyCFString):
* API/JSStringRefCOM.h: Added.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
win:
Reviewed by Sam and Steve.
- Added convenience methods for converting between BSTR and JSSTringRefs
- Added WebKit_debug.def to the project.
* WebKit.vcproj/WebKit.def:
* WebKit.vcproj/WebKit.vcproj:
* WebKit.vcproj/WebKit_debug.def:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27123
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
--- /dev/null
+// -*- mode: c++; c-basic-offset: 4 -*-
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSStringRefCOM.h"
+
+#include "JSStringRef.h"
+
+JSStringRef JSStringCreateWithBSTR(BSTR string)
+{
+ return JSStringCreateWithCharacters(string, SysStringLen(string));
+}
+
+BSTR JSStringCopyBSTR(const JSStringRef string)
+{
+ return SysAllocStringLen(JSStringGetCharactersPtr(string), JSStringGetLength(string));
+}
--- /dev/null
+// -*- mode: c++; c-basic-offset: 4 -*-
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSStringRefCOM_h
+#define JSStringRefCOM_h
+
+#include "JSBase.h"
+
+#include <windows.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// COM convenience methods
+
+/*!
+@function
+@abstract Creates a JavaScript string from a BSTR.
+@param string The BSTR to copy into the new JSString.
+@result A JSString containing string. Ownership follows the Create Rule.
+*/
+JSStringRef JSStringCreateWithBSTR(const BSTR string);
+
+/*!
+@function
+@abstract Creates a BSTR from a JavaScript string.
+@param string The JSString to copy into the new BSTR.
+@result A BSTR containing string. Ownership follows the Create Rule.
+*/
+BSTR JSStringCopyBSTR(const JSStringRef string);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // JSStringRefCOM_h
+2007-10-26 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Sam and Steve.
+
+ - Added convenience methods for converting between BSTR and JSStringRefs
+
+ * API/JSStringRefCOM.cpp: Added.
+ (JSStringCreateWithCFString):
+ (JSStringCopyCFString):
+ * API/JSStringRefCOM.h: Added.
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+
2007-10-26 Mark Rowe <mrowe@apple.com>
Windows build fix.
<Tool\r
Name="VCPreBuildEventTool"\r
Description="Constructing generated files..."\r
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%

bash build-generated-files.sh "$(WebKitOutputDir)" "$(WebKitLibrariesDir)"

mkdir 2>NUL "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"

xcopy /y /d "$(ProjectDir)\..\..\API\APICast.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSBase.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSContextRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSObjectRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRefCF.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSValueRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JavaScriptCore.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSRetainPtr.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
"\r
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%

bash build-generated-files.sh "$(WebKitOutputDir)" "$(WebKitLibrariesDir)"

mkdir 2>NUL "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"

xcopy /y /d "$(ProjectDir)\..\..\API\APICast.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSBase.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSContextRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSObjectRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRefCF.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRefCOM.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSValueRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JavaScriptCore.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSRetainPtr.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
"\r
/>\r
<Tool\r
Name="VCCustomBuildTool"\r
<Tool\r
Name="VCPreBuildEventTool"\r
Description="Constructing generated files..."\r
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%

bash build-generated-files.sh "$(WebKitOutputDir)" "$(WebKitLibrariesDir)"

mkdir 2>NUL "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"

xcopy /y /d "$(ProjectDir)\..\..\API\APICast.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSBase.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSContextRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSObjectRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRefCF.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSValueRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JavaScriptCore.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSRetainPtr.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
"\r
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%

bash build-generated-files.sh "$(WebKitOutputDir)" "$(WebKitLibrariesDir)"

mkdir 2>NUL "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"

xcopy /y /d "$(ProjectDir)\..\..\API\APICast.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSBase.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSContextRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSObjectRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRefCF.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSStringRefCOM.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSValueRef.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JavaScriptCore.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
xcopy /y /d "$(ProjectDir)\..\..\API\JSRetainPtr.h" "$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore"
"\r
/>\r
<Tool\r
Name="VCCustomBuildTool"\r
RelativePath="..\..\API\JSStringRefCF.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\..\API\JSStringRefCOM.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\..\API\JSStringRefCOM.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\..\API\JSValueRef.cpp"\r
>\r
+2007-10-26 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Sam and Steve.
+
+ - Added convenience methods for converting between BSTR and JSSTringRefs
+ - Added WebKit_debug.def to the project.
+
+ * WebKit.vcproj/WebKit.def:
+ * WebKit.vcproj/WebKit.vcproj:
+ * WebKit.vcproj/WebKit_debug.def:
+
2007-10-25 Sam Weinig <sam@webkit.org>
Reviewed by Adam Roben.
JSPropertyNameArrayGetNameAtIndex
JSPropertyNameArrayRelease
JSPropertyNameArrayRetain
+ JSStringCopyBSTR
JSStringCopyCFString
+ JSStringCreateWithBSTR
JSStringCreateWithCFString
JSStringCreateWithCharacters
JSStringCreateWithUTF8CString
RelativePath=".\WebKit.def"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\WebKit_debug.def"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\WebKitGraphics.cpp"\r
>\r
JSPropertyNameArrayGetNameAtIndex
JSPropertyNameArrayRelease
JSPropertyNameArrayRetain
+ JSStringCopyBSTR
JSStringCopyCFString
+ JSStringCreateWithBSTR
JSStringCreateWithCFString
JSStringCreateWithCharacters
JSStringCreateWithUTF8CString