| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 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_DEV_PPB_FILE_REF_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_FILE_REF_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_FILE_REF_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_FILE_REF_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/dev/pp_file_info_dev.h" |
| 8 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/dev/pp_file_info_dev.h" | |
| 10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
| 12 #include "ppapi/c/pp_var.h" | 12 #include "ppapi/c/pp_var.h" |
| 13 | 13 |
| 14 #define PPB_FILEREF_DEV_INTERFACE "PPB_FileRef(Dev);0.5" | 14 #define PPB_FILEREF_DEV_INTERFACE "PPB_FileRef(Dev);0.6" |
| 15 | 15 |
| 16 // A FileRef is a "weak pointer" to a file in a file system. It contains a | 16 // A FileRef is a "weak pointer" to a file in a file system. It contains a |
| 17 // PP_FileSystemType identifier and a file path string. | 17 // PP_FileSystemType identifier and a file path string. |
| 18 struct PPB_FileRef_Dev { | 18 struct PPB_FileRef_Dev { |
| 19 // Creates a weak pointer to a file in the given filesystem. File paths are | 19 // Creates a weak pointer to a file in the given filesystem. File paths are |
| 20 // POSIX style. Returns 0 if the path is malformed. | 20 // POSIX style. Returns 0 if the path is malformed. |
| 21 PP_Resource (*Create)(PP_Resource file_system, const char* path); | 21 PP_Resource (*Create)(PP_Resource file_system, const char* path); |
| 22 | 22 |
| 23 // Returns PP_TRUE if the given resource is a FileRef. Returns PP_FALSE if the | 23 // Returns PP_TRUE if the given resource is a FileRef. Returns PP_FALSE if the |
| 24 // resource is invalid or some type other than a FileRef. | 24 // resource is invalid or some type other than a FileRef. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 44 | 44 |
| 45 // Makes a new directory in the filesystem as well as any parent directories | 45 // Makes a new directory in the filesystem as well as any parent directories |
| 46 // if the make_ancestors parameter is PP_TRUE. It is not valid to make a | 46 // if the make_ancestors parameter is PP_TRUE. It is not valid to make a |
| 47 // directory in the external filesystem. Fails if the directory already | 47 // directory in the external filesystem. Fails if the directory already |
| 48 // exists or if ancestor directories do not exist and make_ancestors was not | 48 // exists or if ancestor directories do not exist and make_ancestors was not |
| 49 // passed as PP_TRUE. | 49 // passed as PP_TRUE. |
| 50 int32_t (*MakeDirectory)(PP_Resource directory_ref, | 50 int32_t (*MakeDirectory)(PP_Resource directory_ref, |
| 51 PP_Bool make_ancestors, | 51 PP_Bool make_ancestors, |
| 52 struct PP_CompletionCallback callback); | 52 struct PP_CompletionCallback callback); |
| 53 | 53 |
| 54 // Queries info about the file. You must have read access to this file if it | |
| 55 // exists in the external filesystem. | |
| 56 int32_t (*Query)(PP_Resource file_ref, | |
| 57 struct PP_FileInfo_Dev* info, | |
| 58 struct PP_CompletionCallback callback); | |
| 59 | |
| 60 // Updates timestamps for a file. You must have write access to the file if | 54 // Updates timestamps for a file. You must have write access to the file if |
| 61 // it exists in the external filesystem. | 55 // it exists in the external filesystem. |
| 62 int32_t (*Touch)(PP_Resource file_ref, | 56 int32_t (*Touch)(PP_Resource file_ref, |
| 63 PP_Time last_access_time, | 57 PP_Time last_access_time, |
| 64 PP_Time last_modified_time, | 58 PP_Time last_modified_time, |
| 65 struct PP_CompletionCallback callback); | 59 struct PP_CompletionCallback callback); |
| 66 | 60 |
| 67 // Delete a file or directory. If file_ref refers to a directory, then the | 61 // Delete a file or directory. If file_ref refers to a directory, then the |
| 68 // directory must be empty. It is an error to delete a file or directory | 62 // directory must be empty. It is an error to delete a file or directory |
| 69 // that is in use. It is not valid to delete a file in the external | 63 // that is in use. It is not valid to delete a file in the external |
| 70 // filesystem. | 64 // filesystem. |
| 71 int32_t (*Delete)(PP_Resource file_ref, | 65 int32_t (*Delete)(PP_Resource file_ref, |
| 72 struct PP_CompletionCallback callback); | 66 struct PP_CompletionCallback callback); |
| 73 | 67 |
| 74 // Rename a file or directory. file_ref and new_file_ref must both refer to | 68 // Rename a file or directory. file_ref and new_file_ref must both refer to |
| 75 // files in the same filesystem. It is an error to rename a file or | 69 // files in the same filesystem. It is an error to rename a file or |
| 76 // directory that is in use. It is not valid to rename a file in the | 70 // directory that is in use. It is not valid to rename a file in the |
| 77 // external filesystem. | 71 // external filesystem. |
| 78 int32_t (*Rename)(PP_Resource file_ref, | 72 int32_t (*Rename)(PP_Resource file_ref, |
| 79 PP_Resource new_file_ref, | 73 PP_Resource new_file_ref, |
| 80 struct PP_CompletionCallback callback); | 74 struct PP_CompletionCallback callback); |
| 81 }; | 75 }; |
| 82 | 76 |
| 83 #endif /* PPAPI_C_DEV_PPB_FILE_REF_DEV_H_ */ | 77 #endif /* PPAPI_C_DEV_PPB_FILE_REF_DEV_H_ */ |
| 84 | 78 |
| OLD | NEW |