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

Unified Diff: ppapi/cpp/file_ref.h

Issue 14784002: Move DirectoryReader::ReadEntries to FileRef::ReadDirectoryEntries (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address dmichael's comments Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/cpp/file_ref.h
diff --git a/ppapi/cpp/file_ref.h b/ppapi/cpp/file_ref.h
index 49a4b98afe5f6429eca9144077a35df068252a00..698175e9f386b8ae28dc90a2f9912418709ee93b 100644
--- a/ppapi/cpp/file_ref.h
+++ b/ppapi/cpp/file_ref.h
@@ -17,6 +17,7 @@
namespace pp {
+class DirectoryEntry;
class FileSystem;
class CompletionCallback;
template <typename T> class CompletionCallbackWithOutput;
@@ -146,7 +147,6 @@ class FileRef : public Resource {
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
int32_t Rename(const FileRef& new_file_ref, const CompletionCallback& cc);
- ///
/// Query() queries info about a file or directory. You must have access to
/// read this file or directory if it exists in the external filesystem.
///
@@ -155,6 +155,29 @@ class FileRef : public Resource {
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
int32_t Query(const CompletionCallbackWithOutput<PP_FileInfo>& callback);
+
+ /// ReadEntries() Reads all entries in the directory.
+ ///
+ /// @param[in] cc A <code>CompletionCallbackWithOutput</code> to be called
+ /// upon completion of ReadEntries(). On success, the directory entries will
+ /// be passed to the given function.
+ ///
+ /// Normally you would use a CompletionCallbackFactory to allow callbacks to
+ /// be bound to your class. See completion_callback_factory.h for more
+ /// discussion on how to use this. Your callback will generally look like:
+ ///
+ /// @code
+ /// void OnReadEntries(int32_t result,
+ /// const std::vector<DirectoryEntry>& entries) {
+ /// if (result == PP_OK)
+ /// // use entries...
+ /// }
+ /// @endcode
+ ///
+ /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ int32_t ReadEntries(
+ const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >&
palmer 2013/05/03 00:07:24 Style nit: No space between < std
hamaji 2013/05/03 01:10:34 Done.
+ callback);
};
} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698