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
3 // found in the LICENSE file.
5 #ifndef PPAPI_CPP_PRIVATE_FLASH_FILE_H_
6 #define PPAPI_CPP_PRIVATE_FLASH_FILE_H_
11 #include "ppapi/c/private/ppb_flash_file.h"
20 // FileModuleLocal -------------------------------------------------------------
22 class FileModuleLocal
{
24 // Returns true if the required interface is available.
25 static bool IsAvailable();
27 // Returns |PP_kInvalidFileHandle| on error.
28 static PP_FileHandle
OpenFile(const InstanceHandle
& instance
,
29 const std::string
& path
,
31 static bool RenameFile(const InstanceHandle
& instance
,
32 const std::string
& path_from
,
33 const std::string
& path_to
);
34 static bool DeleteFileOrDir(const InstanceHandle
& instance
,
35 const std::string
& path
,
37 static bool CreateDir(const InstanceHandle
& instance
,
38 const std::string
& path
);
39 static bool QueryFile(const InstanceHandle
& instance
,
40 const std::string
& path
,
42 // Note that, unlike the C interface, no |FreeDirContents()| is needed.
47 static bool GetDirContents(const InstanceHandle
& instance
,
48 const std::string
& path
,
49 std::vector
<DirEntry
>* dir_contents
);
51 // Returns |PP_kInvalidFileHandle| on error.
52 static PP_FileHandle
CreateTemporaryFile(const InstanceHandle
& instance
);
55 // FileFileRef -----------------------------------------------------------------
59 // Returns true if the required interface is available.
60 static bool IsAvailable();
62 // Returns |PP_kInvalidFileHandle| on error.
63 static PP_FileHandle
OpenFile(const pp::FileRef
& resource
,
65 static bool QueryFile(const pp::FileRef
& resource
,
72 #endif // PPAPI_CPP_PRIVATE_FLASH_FILE_H_