| 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 according to the |
| 94 /// valid to make a directory in the external file system. | 94 /// given <code>make_directory_flags</code>, which is a bit-mask of the |
| 95 /// <strong>Note:</strong> Use MakeDirectoryIncludingAncestors() to create | 95 /// <code>PP_MakeDirectoryFlags</code> values. It is not valid to make a |
| 96 /// parent directories. | 96 /// directory in the external file system. |
| 97 /// | 97 /// |
| 98 /// @param[in] make_directory_flags A bit-mask of the |
| 99 /// <code>PP_MakeDirectoryFlags</code> values. |
| 100 /// See <code>ppb_file_ref.h</code> for more details. |
| 98 /// @param[in] cc A <code>CompletionCallback</code> to be called upon | 101 /// @param[in] cc A <code>CompletionCallback</code> to be called upon |
| 99 /// completion of MakeDirectory(). | 102 /// completion of MakeDirectory(). |
| 100 /// | 103 /// |
| 101 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 104 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 102 /// Succeeds if the directory already exists. Fails if ancestor | 105 int32_t MakeDirectory(int32_t make_directory_flags, |
| 103 /// directortories do not exist (see MakeDirectoryIncludingAncestors for the | 106 const CompletionCallback& cc); |
| 104 /// alternative). | |
| 105 int32_t MakeDirectory(const CompletionCallback& cc); | |
| 106 | |
| 107 /// MakeDirectoryIncludingAncestors() makes a new directory in the file | |
| 108 /// system as well as any parent directories. It is not valid to make a | |
| 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 | 107 |
| 118 /// Touch() Updates time stamps for a file. You must have write access to the | 108 /// Touch() Updates time stamps for a file. You must have write access to the |
| 119 /// file if it exists in the external filesystem. | 109 /// file if it exists in the external filesystem. |
| 120 /// | 110 /// |
| 121 /// @param[in] last_access_time The last time the file was accessed. | 111 /// @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. | 112 /// @param[in] last_modified_time The last time the file was modified. |
| 123 /// @param[in] cc A <code>CompletionCallback</code> to be called upon | 113 /// @param[in] cc A <code>CompletionCallback</code> to be called upon |
| 124 /// completion of Touch(). | 114 /// completion of Touch(). |
| 125 /// | 115 /// |
| 126 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 116 /// @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 /// | 172 /// |
| 183 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 173 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 184 int32_t ReadDirectoryEntries( | 174 int32_t ReadDirectoryEntries( |
| 185 const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >& | 175 const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >& |
| 186 callback); | 176 callback); |
| 187 }; | 177 }; |
| 188 | 178 |
| 189 } // namespace pp | 179 } // namespace pp |
| 190 | 180 |
| 191 #endif // PPAPI_CPP_FILE_REF_H_ | 181 #endif // PPAPI_CPP_FILE_REF_H_ |
| OLD | NEW |