1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_CPP_PRIVATE_FLASH_FILE_H_
#define PPAPI_CPP_PRIVATE_FLASH_FILE_H_
#include <string>
#include <vector>
#include "ppapi/c/private/ppb_flash_file.h"
namespace pp {
class FileRef;
class InstanceHandle;
namespace flash {
// FileModuleLocal -------------------------------------------------------------
class FileModuleLocal {
public:
// Returns true if the required interface is available.
static bool IsAvailable();
// Returns |PP_kInvalidFileHandle| on error.
static PP_FileHandle OpenFile(const InstanceHandle& instance,
const std::string& path,
int32_t mode);
static bool RenameFile(const InstanceHandle& instance,
const std::string& path_from,
const std::string& path_to);
static bool DeleteFileOrDir(const InstanceHandle& instance,
const std::string& path,
bool recursive);
static bool CreateDir(const InstanceHandle& instance,
const std::string& path);
static bool QueryFile(const InstanceHandle& instance,
const std::string& path,
PP_FileInfo* info);
// Note that, unlike the C interface, no |FreeDirContents()| is needed.
struct DirEntry {
std::string name;
bool is_dir;
};
static bool GetDirContents(const InstanceHandle& instance,
const std::string& path,
std::vector<DirEntry>* dir_contents);
// Returns |PP_kInvalidFileHandle| on error.
static PP_FileHandle CreateTemporaryFile(const InstanceHandle& instance);
};
// FileFileRef -----------------------------------------------------------------
class FileFileRef {
public:
// Returns true if the required interface is available.
static bool IsAvailable();
// Returns |PP_kInvalidFileHandle| on error.
static PP_FileHandle OpenFile(const pp::FileRef& resource,
int32_t mode);
static bool QueryFile(const pp::FileRef& resource,
PP_FileInfo* info);
};
} // namespace flash
} // namespace pp
#endif // PPAPI_CPP_PRIVATE_FLASH_FILE_H_
|