2011-03-26 Patrick Gansterer <paroga@webkit.org>
authorparoga@webkit.org <paroga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Mar 2011 07:22:44 +0000 (07:22 +0000)
committerparoga@webkit.org <paroga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Mar 2011 07:22:44 +0000 (07:22 +0000)
        Unreviewed WinCE build fix for r82000.

        * platform/wince/FileSystemWinCE.cpp:
        (WebCore::openFile): Added missing function.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/wince/FileSystemWinCE.cpp

index 9b629f5..160d0c5 100644 (file)
@@ -1,3 +1,10 @@
+2011-03-26  Patrick Gansterer  <paroga@webkit.org>
+
+        Unreviewed WinCE build fix for r82000.
+
+        * platform/wince/FileSystemWinCE.cpp:
+        (WebCore::openFile): Added missing function.
+
 2011-03-25  Kevin Ollivier  <kevino@theolliviers.com>
 
         [wx] Build fix, don't use the new FPD implementation yet, until we can merge ours with it.
index 49acf12..8e29e2e 100644 (file)
@@ -234,6 +234,25 @@ CString openTemporaryFile(const char*, PlatformFileHandle& handle)
     return proposedPath.latin1();
 }
 
+PlatformFileHandle openFile(const String& path, FileOpenMode mode)
+{
+    DWORD desiredAccess = 0;
+    DWORD creationDisposition = 0;
+    switch (mode) {
+        case OpenForRead:
+            desiredAccess = GENERIC_READ;
+            creationDisposition = OPEN_EXISTING;
+        case OpenForWrite:
+            desiredAccess = GENERIC_WRITE;
+            creationDisposition = CREATE_ALWAYS;
+        default:
+            ASSERT_NOT_REACHED();
+    }
+
+    String destination = path;
+    return CreateFile(destination.charactersWithNullTermination(), desiredAccess, 0, 0, creationDisposition, FILE_ATTRIBUTE_NORMAL, 0);
+}
+
 void closeFile(PlatformFileHandle& handle)
 {
     if (isHandleValid(handle)) {