Pepper_56_C++_interfaces
Pepper_56_C++_interfaces
 All Classes Namespaces Files Functions Typedefs Enumerations Macros Groups
file_ref.h
Go to the documentation of this file.
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.
4 
5 #ifndef PPAPI_CPP_FILE_REF_H_
6 #define PPAPI_CPP_FILE_REF_H_
7 
8 #include "ppapi/c/pp_file_info.h"
9 #include "ppapi/c/pp_stdint.h"
10 #include "ppapi/c/ppb_file_ref.h"
11 #include "ppapi/cpp/resource.h"
12 #include "ppapi/cpp/var.h"
13 
17 
18 namespace pp {
19 
20 class DirectoryEntry;
21 class FileSystem;
22 class CompletionCallback;
23 template <typename T> class CompletionCallbackWithOutput;
24 
27 class FileRef : public Resource {
28  public:
31  FileRef() {}
32 
38  explicit FileRef(PP_Resource resource);
39 
44  FileRef(PassRef, PP_Resource resource);
45 
55  FileRef(const FileSystem& file_system, const char* path);
56 
60  FileRef(const FileRef& other);
61 
67  PP_FileSystemType GetFileSystemType() const;
68 
75  Var GetName() const;
76 
82  Var GetPath() const;
83 
91  FileRef GetParent() const;
92 
105  int32_t MakeDirectory(int32_t make_directory_flags,
106  const CompletionCallback& cc);
107 
117  int32_t Touch(PP_Time last_access_time,
118  PP_Time last_modified_time,
119  const CompletionCallback& cc);
120 
130  int32_t Delete(const CompletionCallback& cc);
131 
143  int32_t Rename(const FileRef& new_file_ref, const CompletionCallback& cc);
144 
152  int32_t Query(const CompletionCallbackWithOutput<PP_FileInfo>& callback);
153 
174  int32_t ReadDirectoryEntries(
175  const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >&
176  callback);
177 };
178 
179 } // namespace pp
180 
181 #endif // PPAPI_CPP_FILE_REF_H_
PP_FileSystemType GetFileSystemType() const
int32_t Delete(const CompletionCallback &cc)
FileRef GetParent() const
Definition: file_ref.h:27
int32_t Touch(PP_Time last_access_time, PP_Time last_modified_time, const CompletionCallback &cc)
Definition: completion_callback.h:189
int32_t MakeDirectory(int32_t make_directory_flags, const CompletionCallback &cc)
Definition: completion_callback.h:26
FileRef()
Definition: file_ref.h:31
int32_t ReadDirectoryEntries(const CompletionCallbackWithOutput< std::vector< DirectoryEntry > > &callback)
PassRef
Definition: pass_ref.h:17
Var GetPath() const
Var GetName() const
Definition: file_system.h:24
int32_t Rename(const FileRef &new_file_ref, const CompletionCallback &cc)
int32_t Query(const CompletionCallbackWithOutput< PP_FileInfo > &callback)
A generic type used for passing data types between the module and the page.
Definition: var.h:23
A reference counted module resource.
Definition: resource.h:20