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
3 // found in the LICENSE file.
5 #ifndef PPAPI_CPP_DEV_DIRECTORY_READER_DEV_H_
6 #define PPAPI_CPP_DEV_DIRECTORY_READER_DEV_H_
10 #include "ppapi/c/dev/ppb_directory_reader_dev.h"
11 #include "ppapi/cpp/resource.h"
15 class DirectoryEntry_Dev
;
17 template<typename T
> class CompletionCallbackWithOutput
;
19 class DirectoryReader_Dev
: public Resource
{
21 /// A constructor that creates a DirectoryReader resource for the given
24 /// @param[in] directory_ref A <code>PP_Resource</code> corresponding to the
25 /// directory reference to be read.
26 explicit DirectoryReader_Dev(const FileRef
& directory_ref
);
28 DirectoryReader_Dev(const DirectoryReader_Dev
& other
);
30 /// ReadEntries() Reads all entries in the directory.
32 /// @param[in] cc A <code>CompletionCallbackWithOutput</code> to be called
33 /// upon completion of ReadEntries(). On success, the directory entries will
34 /// be passed to the given function.
36 /// Normally you would use a CompletionCallbackFactory to allow callbacks to
37 /// be bound to your class. See completion_callback_factory.h for more
38 /// discussion on how to use this. Your callback will generally look like:
41 /// void OnReadEntries(int32_t result,
42 /// const std::vector<DirectoryEntry_Dev>& entries) {
43 /// if (result == PP_OK)
48 /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
50 const CompletionCallbackWithOutput
< std::vector
<DirectoryEntry_Dev
> >&
56 #endif // PPAPI_CPP_DIRECTORY_READER_H_