ipc/chromium/src/base/platform_file.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
michael@0 2 // Use of this source code is governed by a BSD-style license that can be
michael@0 3 // found in the LICENSE file.
michael@0 4
michael@0 5 #ifndef BASE_PLATFORM_FILE_H_
michael@0 6 #define BASE_PLATFORM_FILE_H_
michael@0 7
michael@0 8 #include "build/build_config.h"
michael@0 9 #if defined(OS_WIN)
michael@0 10 #include <windows.h>
michael@0 11 #endif
michael@0 12
michael@0 13 #include <string>
michael@0 14
michael@0 15 namespace base {
michael@0 16
michael@0 17 #if defined(OS_WIN)
michael@0 18 typedef HANDLE PlatformFile;
michael@0 19 const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE;
michael@0 20 #elif defined(OS_POSIX)
michael@0 21 typedef int PlatformFile;
michael@0 22 const PlatformFile kInvalidPlatformFileValue = -1;
michael@0 23 #endif
michael@0 24
michael@0 25 enum PlatformFileFlags {
michael@0 26 PLATFORM_FILE_OPEN = 1,
michael@0 27 PLATFORM_FILE_CREATE = 2,
michael@0 28 PLATFORM_FILE_OPEN_ALWAYS = 4, // May create a new file.
michael@0 29 PLATFORM_FILE_CREATE_ALWAYS = 8, // May overwrite an old file.
michael@0 30 PLATFORM_FILE_READ = 16,
michael@0 31 PLATFORM_FILE_WRITE = 32,
michael@0 32 PLATFORM_FILE_EXCLUSIVE_READ = 64, // EXCLUSIVE is opposite of Windows SHARE
michael@0 33 PLATFORM_FILE_EXCLUSIVE_WRITE = 128,
michael@0 34 PLATFORM_FILE_ASYNC = 256
michael@0 35 };
michael@0 36
michael@0 37 // Creates or open the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and
michael@0 38 // |created| is provided, |created| will be set to true if the file was created
michael@0 39 // or to false in case the file was just opened.
michael@0 40 PlatformFile CreatePlatformFile(const std::wstring& name,
michael@0 41 int flags,
michael@0 42 bool* created);
michael@0 43
michael@0 44 } // namespace base
michael@0 45
michael@0 46 #endif // BASE_PLATFORM_FILE_H_

mercurial