OLD | NEW |
---|---|
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 | 6 |
7 /** | 7 /** |
8 * This file defines the API to create a file i/o object. | 8 * This file defines the API to create a file i/o object. |
9 */ | 9 */ |
10 | 10 |
11 [generate_thunk] | 11 [generate_thunk] |
12 | 12 |
13 label Chrome { | 13 label Chrome { |
14 M14 = 1.0, | 14 M14 = 1.0, |
15 M25 = 1.1 | 15 M25 = 1.1, |
16 M29 = 1.2 | |
16 }; | 17 }; |
17 | 18 |
18 /** | 19 /** |
19 * The PP_FileOpenFlags enum contains file open constants. | 20 * The PP_FileOpenFlags enum contains file open constants. |
20 */ | 21 */ |
21 [assert_size(4)] | 22 [assert_size(4)] |
22 enum PP_FileOpenFlags { | 23 enum PP_FileOpenFlags { |
23 /** Requests read access to a file. */ | 24 /** Requests read access to a file. */ |
24 PP_FILEOPENFLAG_READ = 1 << 0, | 25 PP_FILEOPENFLAG_READ = 1 << 0, |
25 | 26 |
26 /** | 27 /** |
27 * Requests write access to a file. May be combined with | 28 * Requests write access to a file. May be combined with |
28 * <code>PP_FILEOPENFLAG_READ</code> to request read and write access. | 29 * <code>PP_FILEOPENFLAG_READ</code> to request read and write access. |
29 */ | 30 */ |
30 PP_FILEOPENFLAG_WRITE = 1 << 1, | 31 PP_FILEOPENFLAG_WRITE = 1 << 1, |
31 | 32 |
32 /** | 33 /** |
33 * Requests that the file be created if it does not exist. If the file | 34 * Requests that the file be created if it does not exist. If the file |
34 * already exists, then this flag is ignored unless | 35 * already exists, then this flag is ignored unless |
35 * <code>PP_FILEOPENFLAG_EXCLUSIVE</code> was also specified, in which case | 36 * <code>PP_FILEOPENFLAG_EXCLUSIVE</code> was also specified, in which case |
36 * FileIO::Open() will fail. | 37 * FileIO::Open() will fail. |
37 */ | 38 */ |
38 PP_FILEOPENFLAG_CREATE = 1 << 2, | 39 PP_FILEOPENFLAG_CREATE = 1 << 2, |
39 | 40 |
40 /** | 41 /** |
41 * Requests that the file be truncated to length 0 if it exists and is a | 42 * Requests that the file be truncated to length 0 if it exists and is a |
42 * regular file. <code>PP_FILEOPENFLAG_WRITE</code> must also be specified. | 43 * regular file. <code>PP_FILEOPENFLAG_WRITE</code> must also be specified. |
43 */ | 44 */ |
44 PP_FILEOPENFLAG_TRUNCATE = 1 << 3, | 45 PP_FILEOPENFLAG_TRUNCATE = 1 << 3, |
45 | 46 |
46 /** | 47 /** |
47 * Requests that the file is created when this flag is combined with | 48 * Requests that the file is created when this flag is combined with |
48 * <code>PP_FILEOPENFLAG_CREATE</code>. If this flag is specified, and the | 49 * <code>PP_FILEOPENFLAG_CREATE</code>. If this flag is specified, and the |
49 * file already exists, then the FileIO::Open() call will fail. | 50 * file already exists, then the FileIO::Open() call will fail. |
50 */ | 51 */ |
51 PP_FILEOPENFLAG_EXCLUSIVE = 1 << 4 | 52 PP_FILEOPENFLAG_EXCLUSIVE = 1 << 4, |
53 | |
54 /** | |
55 * Requests write access to a file, but writes will always occur at the end of | |
56 * the file. Mututally exclusive with <code>PP_FILEOPENFLAG_WRITE</code>. | |
57 * | |
58 * This is only supported in version 1.2 (M29) and later. | |
yzshen1
2013/06/11 20:49:32
I think it is allowed to have [version=xx] label o
| |
59 */ | |
60 PP_FILEOPENFLAG_APPEND = 1 << 5 | |
52 }; | 61 }; |
53 | 62 |
54 | 63 |
55 /** | 64 /** |
56 * The <code>PPB_FileIO</code> struct is used to operate on a regular file | 65 * The <code>PPB_FileIO</code> struct is used to operate on a regular file |
57 * (PP_FileType_Regular). | 66 * (PP_FileType_Regular). |
58 */ | 67 */ |
59 interface PPB_FileIO { | 68 interface PPB_FileIO { |
60 /** | 69 /** |
61 * Create() creates a new FileIO object. | 70 * Create() creates a new FileIO object. |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 * cannot be interleaved with other operations. | 277 * cannot be interleaved with other operations. |
269 */ | 278 */ |
270 [version = 1.1] | 279 [version = 1.1] |
271 int32_t ReadToArray([in] PP_Resource file_io, | 280 int32_t ReadToArray([in] PP_Resource file_io, |
272 [in] int64_t offset, | 281 [in] int64_t offset, |
273 [in] int32_t max_read_length, | 282 [in] int32_t max_read_length, |
274 [inout] PP_ArrayOutput output, | 283 [inout] PP_ArrayOutput output, |
275 [in] PP_CompletionCallback callback); | 284 [in] PP_CompletionCallback callback); |
276 }; | 285 }; |
277 | 286 |
OLD | NEW |