OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 #ifndef PPAPI_C_PP_FILE_INFO_H_ | 5 #ifndef PPAPI_C_PP_FILE_INFO_H_ |
6 #define PPAPI_C_PP_FILE_INFO_H_ | 6 #define PPAPI_C_PP_FILE_INFO_H_ |
7 | 7 |
8 #include "ppapi/c/pp_macros.h" | 8 #include "ppapi/c/pp_macros.h" |
9 #include "ppapi/c/pp_stdint.h" | 9 #include "ppapi/c/pp_stdint.h" |
10 #include "ppapi/c/pp_time.h" | 10 #include "ppapi/c/pp_time.h" |
11 | 11 |
| 12 /** |
| 13 * @file |
| 14 * This file defines three enumerations for use in the PPAPI C file IO APIs. |
| 15 */ |
| 16 |
| 17 /** |
| 18 * @addtogroup Enums |
| 19 * @{ |
| 20 */ |
| 21 |
| 22 /** |
| 23 * The <code>PP_FileType</code> enum contains file type constants. |
| 24 */ |
12 typedef enum { | 25 typedef enum { |
| 26 /** A regular file type */ |
13 PP_FILETYPE_REGULAR, | 27 PP_FILETYPE_REGULAR, |
| 28 /** A directory */ |
14 PP_FILETYPE_DIRECTORY, | 29 PP_FILETYPE_DIRECTORY, |
15 PP_FILETYPE_OTHER /* A catch-all for unidentified types. */ | 30 /** A catch-all for unidentified types */ |
| 31 PP_FILETYPE_OTHER |
16 } PP_FileType; | 32 } PP_FileType; |
17 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileType, 4); | 33 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileType, 4); |
18 | 34 |
| 35 /** |
| 36 * The <code>PP_FileSystemType</code> enum contains file system type constants. |
| 37 */ |
19 typedef enum { | 38 typedef enum { |
20 PP_FILESYSTEMTYPE_INVALID = 0, /* For identifying invalid return values. */ | 39 /** For identified invalid return values */ |
| 40 PP_FILESYSTEMTYPE_INVALID = 0, |
| 41 /** For external file system types */ |
21 PP_FILESYSTEMTYPE_EXTERNAL, | 42 PP_FILESYSTEMTYPE_EXTERNAL, |
| 43 /** For local persistant file system types */ |
22 PP_FILESYSTEMTYPE_LOCALPERSISTENT, | 44 PP_FILESYSTEMTYPE_LOCALPERSISTENT, |
| 45 /** For local temporary file system types */ |
23 PP_FILESYSTEMTYPE_LOCALTEMPORARY | 46 PP_FILESYSTEMTYPE_LOCALTEMPORARY |
24 } PP_FileSystemType; | 47 } PP_FileSystemType; |
25 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileSystemType, 4); | 48 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileSystemType, 4); |
| 49 /** |
| 50 * @} |
| 51 */ |
26 | 52 |
| 53 /** |
| 54 * @addtogroup Structs |
| 55 * @{ |
| 56 */ |
| 57 /** |
| 58 * The <code>PP_FileInfo</code> struct represents all information about a file, |
| 59 * such as size, type, and creation time. |
| 60 */ |
27 struct PP_FileInfo { | 61 struct PP_FileInfo { |
| 62 /** This value represents the size of the file. */ |
28 int64_t size; /* Measured in bytes */ | 63 int64_t size; /* Measured in bytes */ |
| 64 |
| 65 /** |
| 66 * This value represents the type of file as defined by the |
| 67 * <code>PP_FileType</code> enum |
| 68 */ |
29 PP_FileType type; | 69 PP_FileType type; |
| 70 |
| 71 /** |
| 72 * This value represents the file system type of the file as defined by the |
| 73 * <code>PP_FileSystemType</code> enum. |
| 74 */ |
30 PP_FileSystemType system_type; | 75 PP_FileSystemType system_type; |
| 76 |
| 77 /** |
| 78 * This value represents the creation time of the file. |
| 79 */ |
31 PP_Time creation_time; | 80 PP_Time creation_time; |
| 81 |
| 82 /** |
| 83 * This value represents the last time the file was accessed. |
| 84 */ |
32 PP_Time last_access_time; | 85 PP_Time last_access_time; |
| 86 |
| 87 /** |
| 88 * This value represents the last time the file was modified. |
| 89 */ |
33 PP_Time last_modified_time; | 90 PP_Time last_modified_time; |
34 }; | 91 }; |
35 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FileInfo, 40); | 92 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FileInfo, 40); |
| 93 /** |
| 94 * @} |
| 95 */ |
36 | 96 |
37 #endif /* PPAPI_C_PP_FILE_INFO_H_ */ | 97 #endif /* PPAPI_C_PP_FILE_INFO_H_ */ |
OLD | NEW |