| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PRIVATE_FLASH_FILE_H_ | 5 #ifndef PPAPI_CPP_PRIVATE_FLASH_FILE_H_ |
| 6 #define PPAPI_CPP_PRIVATE_FLASH_FILE_H_ | 6 #define PPAPI_CPP_PRIVATE_FLASH_FILE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const std::string& path_to); | 36 const std::string& path_to); |
| 37 static bool DeleteFileOrDir(const InstanceHandle& instance, | 37 static bool DeleteFileOrDir(const InstanceHandle& instance, |
| 38 const std::string& path, | 38 const std::string& path, |
| 39 bool recursive); | 39 bool recursive); |
| 40 static bool CreateDir(const InstanceHandle& instance, | 40 static bool CreateDir(const InstanceHandle& instance, |
| 41 const std::string& path); | 41 const std::string& path); |
| 42 static bool QueryFile(const InstanceHandle& instance, | 42 static bool QueryFile(const InstanceHandle& instance, |
| 43 const std::string& path, | 43 const std::string& path, |
| 44 PP_FileInfo* info); | 44 PP_FileInfo* info); |
| 45 // Note that, unlike the C interface, no |FreeDirContents()| is needed. | 45 // Note that, unlike the C interface, no |FreeDirContents()| is needed. |
| 46 struct DirEntry { |
| 47 std::string name; |
| 48 bool is_dir; |
| 49 }; |
| 46 static bool GetDirContents(const InstanceHandle& instance, | 50 static bool GetDirContents(const InstanceHandle& instance, |
| 47 const std::string& path, | 51 const std::string& path, |
| 48 std::vector<PP_DirEntry_Dev>* dir_contents); | 52 std::vector<DirEntry>* dir_contents); |
| 49 | 53 |
| 50 // Returns true if |CreateTemporaryFile()| is supported. | 54 // Returns true if |CreateTemporaryFile()| is supported. |
| 51 // TODO(viettrungluu): Remove this sometime after M21 ships to Stable? | 55 // TODO(viettrungluu): Remove this sometime after M21 ships to Stable? |
| 52 static bool IsCreateTemporaryFileAvailable(); | 56 static bool IsCreateTemporaryFileAvailable(); |
| 53 // Returns |PP_kInvalidFileHandle| on error. | 57 // Returns |PP_kInvalidFileHandle| on error. |
| 54 static PP_FileHandle CreateTemporaryFile(const InstanceHandle& instance); | 58 static PP_FileHandle CreateTemporaryFile(const InstanceHandle& instance); |
| 55 }; | 59 }; |
| 56 | 60 |
| 57 // FileFileRef ----------------------------------------------------------------- | 61 // FileFileRef ----------------------------------------------------------------- |
| 58 | 62 |
| 59 class FileFileRef { | 63 class FileFileRef { |
| 60 public: | 64 public: |
| 61 // Returns true if the required interface is available. | 65 // Returns true if the required interface is available. |
| 62 static bool IsAvailable(); | 66 static bool IsAvailable(); |
| 63 | 67 |
| 64 // Returns |PP_kInvalidFileHandle| on error. | 68 // Returns |PP_kInvalidFileHandle| on error. |
| 65 static PP_FileHandle OpenFile(const pp::FileRef& resource, | 69 static PP_FileHandle OpenFile(const pp::FileRef& resource, |
| 66 int32_t mode); | 70 int32_t mode); |
| 67 static bool QueryFile(const pp::FileRef& resource, | 71 static bool QueryFile(const pp::FileRef& resource, |
| 68 PP_FileInfo* info); | 72 PP_FileInfo* info); |
| 69 }; | 73 }; |
| 70 | 74 |
| 71 } // namespace flash | 75 } // namespace flash |
| 72 } // namespace pp | 76 } // namespace pp |
| 73 | 77 |
| 74 #endif // PPAPI_CPP_PRIVATE_FLASH_FILE_H_ | 78 #endif // PPAPI_CPP_PRIVATE_FLASH_FILE_H_ |
| OLD | NEW |