Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: ppapi/c/dev/ppb_file_ref_dev.h

Issue 7387011: Clean up the file dev interfaces. The combination of some dev and some non (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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/ppb_file_ref.h"
9 #include "ppapi/c/pp_bool.h"
10 #include "ppapi/c/pp_instance.h"
11 #include "ppapi/c/pp_resource.h"
12 #include "ppapi/c/pp_var.h"
13
14 struct PP_CompletionCallback;
15 9
16 #define PPB_FILEREF_DEV_INTERFACE_0_8 "PPB_FileRef(Dev);0.8" 10 #define PPB_FILEREF_DEV_INTERFACE_0_8 "PPB_FileRef(Dev);0.8"
17 #define PPB_FILEREF_DEV_INTERFACE PPB_FILEREF_DEV_INTERFACE_0_8 11 #define PPB_FILEREF_DEV_INTERFACE PPB_FILEREF_DEV_INTERFACE_0_8
18 12
19 // A FileRef is a "weak pointer" to a file in a file system. It contains a 13 typedef struct PPB_FileRef PPB_FileRef_Dev;
20 // PP_FileSystemType identifier and a file path string.
21 struct PPB_FileRef_Dev {
22 // Creates a weak pointer to a file in the given filesystem. File paths are
23 // POSIX style. Returns 0 if the path is malformed.
24 PP_Resource (*Create)(PP_Resource file_system, const char* path);
25
26 // Returns PP_TRUE if the given resource is a FileRef. Returns PP_FALSE if the
27 // resource is invalid or some type other than a FileRef.
28 PP_Bool (*IsFileRef)(PP_Resource resource);
29
30 // Returns the file system identifier of this file, or
31 // PP_FILESYSTEMTYPE_INVALID if the file ref is invalid.
32 PP_FileSystemType_Dev (*GetFileSystemType)(PP_Resource file_ref);
33
34 // Returns the name of the file. The value returned by this function does not
35 // include any path component (such as the name of the parent directory, for
36 // example). It is just the name of the file. To get the full file path, use
37 // the GetPath() function.
38 struct PP_Var (*GetName)(PP_Resource file_ref);
39
40 // Returns the absolute path of the file. This method fails if the file
41 // system type is PP_FileSystemType_External.
42 struct PP_Var (*GetPath)(PP_Resource file_ref);
43
44 // Returns the parent directory of this file. If file_ref points to the root
45 // of the filesystem, then the root is returned. This method fails if the
46 // file system type is PP_FileSystemType_External.
47 PP_Resource (*GetParent)(PP_Resource file_ref);
48
49 // Makes a new directory in the filesystem as well as any parent directories
50 // if the make_ancestors parameter is PP_TRUE. It is not valid to make a
51 // directory in the external filesystem. Fails if the directory already
52 // exists or if ancestor directories do not exist and make_ancestors was not
53 // passed as PP_TRUE.
54 int32_t (*MakeDirectory)(PP_Resource directory_ref,
55 PP_Bool make_ancestors,
56 struct PP_CompletionCallback callback);
57
58 // Updates timestamps for a file. You must have write access to the file if
59 // it exists in the external filesystem.
60 int32_t (*Touch)(PP_Resource file_ref,
61 PP_Time last_access_time,
62 PP_Time last_modified_time,
63 struct PP_CompletionCallback callback);
64
65 // Delete a file or directory. If file_ref refers to a directory, then the
66 // directory must be empty. It is an error to delete a file or directory
67 // that is in use. It is not valid to delete a file in the external
68 // filesystem.
69 int32_t (*Delete)(PP_Resource file_ref,
70 struct PP_CompletionCallback callback);
71
72 // Rename a file or directory. file_ref and new_file_ref must both refer to
73 // files in the same filesystem. It is an error to rename a file or
74 // directory that is in use. It is not valid to rename a file in the
75 // external filesystem.
76 int32_t (*Rename)(PP_Resource file_ref,
77 PP_Resource new_file_ref,
78 struct PP_CompletionCallback callback);
79 };
80 14
81 #endif /* PPAPI_C_DEV_PPB_FILE_REF_DEV_H_ */ 15 #endif /* PPAPI_C_DEV_PPB_FILE_REF_DEV_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698