| 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_DEV_DIRECTORY_READER_DEV_H_ | 5 #ifndef PPAPI_CPP_DIRECTORY_READER_H_ |
| 6 #define PPAPI_CPP_DEV_DIRECTORY_READER_DEV_H_ | 6 #define PPAPI_CPP_DIRECTORY_READER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ppapi/c/dev/ppb_directory_reader_dev.h" | 10 #include "ppapi/c/ppb_directory_reader.h" |
| 11 #include "ppapi/cpp/resource.h" | 11 #include "ppapi/cpp/resource.h" |
| 12 | 12 |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 class DirectoryEntry_Dev; | 15 class DirectoryEntry; |
| 16 class FileRef; | 16 class FileRef; |
| 17 template<typename T> class CompletionCallbackWithOutput; | 17 template<typename T> class CompletionCallbackWithOutput; |
| 18 | 18 |
| 19 class DirectoryReader_Dev : public Resource { | 19 class DirectoryReader : public Resource { |
| 20 public: | 20 public: |
| 21 /// A constructor that creates a DirectoryReader resource for the given | 21 /// A constructor that creates a DirectoryReader resource for the given |
| 22 /// directory. | 22 /// directory. |
| 23 /// | 23 /// |
| 24 /// @param[in] directory_ref A <code>PP_Resource</code> corresponding to the | 24 /// @param[in] directory_ref A <code>PP_Resource</code> corresponding to the |
| 25 /// directory reference to be read. | 25 /// directory reference to be read. |
| 26 explicit DirectoryReader_Dev(const FileRef& directory_ref); | 26 explicit DirectoryReader(const FileRef& directory_ref); |
| 27 | 27 |
| 28 DirectoryReader_Dev(const DirectoryReader_Dev& other); | 28 DirectoryReader(const DirectoryReader& other); |
| 29 | 29 |
| 30 /// ReadEntries() Reads all entries in the directory. | 30 /// ReadEntries() Reads all entries in the directory. |
| 31 /// | 31 /// |
| 32 /// @param[in] cc A <code>CompletionCallbackWithOutput</code> to be called | 32 /// @param[in] cc A <code>CompletionCallbackWithOutput</code> to be called |
| 33 /// upon completion of ReadEntries(). On success, the directory entries will | 33 /// upon completion of ReadEntries(). On success, the directory entries will |
| 34 /// be passed to the given function. | 34 /// be passed to the given function. |
| 35 /// | 35 /// |
| 36 /// Normally you would use a CompletionCallbackFactory to allow callbacks to | 36 /// Normally you would use a CompletionCallbackFactory to allow callbacks to |
| 37 /// be bound to your class. See completion_callback_factory.h for more | 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: | 38 /// discussion on how to use this. Your callback will generally look like: |
| 39 /// | 39 /// |
| 40 /// @code | 40 /// @code |
| 41 /// void OnReadEntries(int32_t result, | 41 /// void OnReadEntries(int32_t result, |
| 42 /// const std::vector<DirectoryEntry_Dev>& entries) { | 42 /// const std::vector<DirectoryEntry>& entries) { |
| 43 /// if (result == PP_OK) | 43 /// if (result == PP_OK) |
| 44 /// // use entries... | 44 /// // use entries... |
| 45 /// } | 45 /// } |
| 46 /// @endcode | 46 /// @endcode |
| 47 /// | 47 /// |
| 48 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 48 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 49 int32_t ReadEntries( | 49 int32_t ReadEntries( |
| 50 const CompletionCallbackWithOutput< std::vector<DirectoryEntry_Dev> >& | 50 const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >& |
| 51 callback); | 51 callback); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace pp | 54 } // namespace pp |
| 55 | 55 |
| 56 #endif // PPAPI_CPP_DIRECTORY_READER_H_ | 56 #endif // PPAPI_CPP_DIRECTORY_READER_H_ |
| OLD | NEW |