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_CPP_FILE_REF_H_ | 5 #ifndef PPAPI_CPP_FILE_REF_H_ |
6 #define PPAPI_CPP_FILE_REF_H_ | 6 #define PPAPI_CPP_FILE_REF_H_ |
7 | 7 |
8 #include "ppapi/c/pp_file_info.h" | 8 #include "ppapi/c/pp_file_info.h" |
9 #include "ppapi/c/pp_stdint.h" | 9 #include "ppapi/c/pp_stdint.h" |
10 #include "ppapi/c/ppb_file_ref.h" | 10 #include "ppapi/c/ppb_file_ref.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 /// GetParent() returns the parent directory of this file. If | 84 /// GetParent() returns the parent directory of this file. If |
85 /// <code>file_ref</code> points to the root of the filesystem, then the root | 85 /// <code>file_ref</code> points to the root of the filesystem, then the root |
86 /// is returned. | 86 /// is returned. |
87 /// | 87 /// |
88 /// @return A <code>FileRef</code> containing the parent directory of the | 88 /// @return A <code>FileRef</code> containing the parent directory of the |
89 /// file. This function fails if the file system type is | 89 /// file. This function fails if the file system type is |
90 /// <code>PP_FileSystemType_External</code>. | 90 /// <code>PP_FileSystemType_External</code>. |
91 FileRef GetParent() const; | 91 FileRef GetParent() const; |
92 | 92 |
93 /// MakeDirectory() makes a new directory in the file system. It is not | 93 /// MakeDirectory() makes a new directory in the file system as well as any |
94 /// valid to make a directory in the external file system. | 94 /// parent directories if the <code>make_ancestors</code> argument is |
95 /// <strong>Note:</strong> Use MakeDirectoryIncludingAncestors() to create | 95 /// <code>true</code>. It is not valid to make a directory in the external |
96 /// parent directories. | 96 /// file system. |
97 /// | 97 /// |
| 98 /// @param[in] exclusive A <code>bool</code> set to <code>true</code> to fail |
| 99 /// if the directory already exists. |
| 100 /// @param[in] make_ancestors A <code>bool</code> set to <code>true</code> to |
| 101 /// make ancestor directories or <code>false</code> if ancestor directories |
| 102 /// are not needed. |
98 /// @param[in] cc A <code>CompletionCallback</code> to be called upon | 103 /// @param[in] cc A <code>CompletionCallback</code> to be called upon |
99 /// completion of MakeDirectory(). | 104 /// completion of MakeDirectory(). |
100 /// | 105 /// |
101 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 106 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
102 /// Succeeds if the directory already exists. Fails if ancestor | 107 /// Fails if the directory already exists and <code>exclusive</code> was |
103 /// directortories do not exist (see MakeDirectoryIncludingAncestors for the | 108 /// passed as <code>true</code>. And also fails if ancestor directortories |
104 /// alternative). | 109 /// do not exist and <code>make_ancestors</code> was passed as |
105 int32_t MakeDirectory(const CompletionCallback& cc); | 110 /// <code>false</code>. |
106 | 111 int32_t MakeDirectory(bool exclusive, |
107 /// MakeDirectoryIncludingAncestors() makes a new directory in the file | 112 bool make_ancestors, |
108 /// system as well as any parent directories. It is not valid to make a | 113 const CompletionCallback& cc); |
109 /// directory in the external file system. | |
110 /// | |
111 /// @param[in] cc A <code>CompletionCallback</code> to be called upon | |
112 /// completion of MakeDirectoryIncludingAncestors(). | |
113 /// | |
114 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
115 /// Succeeds if the directory already exists. | |
116 int32_t MakeDirectoryIncludingAncestors(const CompletionCallback& cc); | |
117 | 114 |
118 /// Touch() Updates time stamps for a file. You must have write access to the | 115 /// Touch() Updates time stamps for a file. You must have write access to the |
119 /// file if it exists in the external filesystem. | 116 /// file if it exists in the external filesystem. |
120 /// | 117 /// |
121 /// @param[in] last_access_time The last time the file was accessed. | 118 /// @param[in] last_access_time The last time the file was accessed. |
122 /// @param[in] last_modified_time The last time the file was modified. | 119 /// @param[in] last_modified_time The last time the file was modified. |
123 /// @param[in] cc A <code>CompletionCallback</code> to be called upon | 120 /// @param[in] cc A <code>CompletionCallback</code> to be called upon |
124 /// completion of Touch(). | 121 /// completion of Touch(). |
125 /// | 122 /// |
126 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 123 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 /// | 179 /// |
183 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 180 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
184 int32_t ReadDirectoryEntries( | 181 int32_t ReadDirectoryEntries( |
185 const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >& | 182 const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >& |
186 callback); | 183 callback); |
187 }; | 184 }; |
188 | 185 |
189 } // namespace pp | 186 } // namespace pp |
190 | 187 |
191 #endif // PPAPI_CPP_FILE_REF_H_ | 188 #endif // PPAPI_CPP_FILE_REF_H_ |
OLD | NEW |