Pepper_47_C++_interfaces
Public Member Functions | Static Public Member Functions | List of all members
pp::FileSystem Class Reference

#include <file_system.h>

Inheritance diagram for pp::FileSystem:
Inheritance graph
Collaboration diagram for pp::FileSystem:
Collaboration graph

Public Member Functions

 FileSystem ()
 
 FileSystem (const FileSystem &other)
 
 FileSystem (const Resource &resource)
 
 FileSystem (PassRef, PP_Resource resource)
 
 FileSystem (const InstanceHandle &instance, PP_FileSystemType type)
 
int32_t Open (int64_t expected_size, const CompletionCallback &cc)
 
- Public Member Functions inherited from pp::Resource
 Resource ()
 The default constructor. More...
 
 Resource (const Resource &other)
 
virtual ~Resource ()
 Destructor. More...
 
Resourceoperator= (const Resource &other)
 
bool is_null () const
 
PP_Resource pp_resource () const
 
PP_Resource detach ()
 

Static Public Member Functions

static bool IsFileSystem (const Resource &resource)
 

Additional Inherited Members

- Protected Member Functions inherited from pp::Resource
 Resource (PP_Resource resource)
 
 Resource (PassRef, PP_Resource resource)
 
void PassRefFromConstructor (PP_Resource resource)
 
void Clear ()
 Sets this resource to null. This releases ownership of the resource. More...
 

Detailed Description

The FileSystem class identifies the file system type associated with a file.

Definition at line 24 of file file_system.h.

Constructor & Destructor Documentation

pp::FileSystem::FileSystem ( )

Constructs an is_null() filesystem resource. If you use this constructor, you will have to assign it to a "real" FileSystem object before you can use it.

Definition at line 26 of file file_system.cc.

pp::FileSystem::FileSystem ( const FileSystem other)

The copy constructor for FileSystem.

Parameters
[in]otherA reference to a FileSystem.

Definition at line 29 of file file_system.cc.

pp::FileSystem::FileSystem ( const Resource resource)
explicit

Constructs a FileSystem from a Resource.

Parameters
[in]resourceA Resource containing a file system.

Definition at line 32 of file file_system.cc.

References pp::Resource::Clear(), IsFileSystem(), and PP_NOTREACHED.

pp::FileSystem::FileSystem ( PassRef  ,
PP_Resource  resource 
)

A constructor used when you have received a PP_Resource as a return value that has already been reference counted.

Parameters
[in]resourceA PP_Resource corresponding to a PPB_FileSystem.

Definition at line 41 of file file_system.cc.

pp::FileSystem::FileSystem ( const InstanceHandle instance,
PP_FileSystemType  type 
)

This constructor creates a file system object of the given type.

Parameters
[in]instanceThe instance with which this resource will be associated.
[in]typeA file system type as defined by PP_FileSystemType enum.

Definition at line 45 of file file_system.cc.

References pp::Resource::PassRefFromConstructor(), and pp::InstanceHandle::pp_instance().

Member Function Documentation

bool pp::FileSystem::IsFileSystem ( const Resource resource)
static

Checks whether a Resource is a file system, to test whether it is appropriate for use with the FileSystem constructor.

Parameters
[in]resourceA Resource to test.
Returns
True if resource is a file system.

Definition at line 62 of file file_system.cc.

References pp::Resource::pp_resource().

Referenced by FileSystem().

int32_t pp::FileSystem::Open ( int64_t  expected_size,
const CompletionCallback cc 
)

Open() opens the file system. A file system must be opened before running any other operation on it.

Parameters
[in]expected_sizeThe expected size of the file system. Note that this does not request quota; to do that, you must either invoke requestQuota from JavaScript: http://www.html5rocks.com/en/tutorials/file/filesystem/#toc-requesting-quota or set the unlimitedStorage permission for Chrome Web Store apps: http://code.google.com/chrome/extensions/manifest.html#permissions
[in]ccA PP_CompletionCallback to be called upon completion of Open().
Returns
An int32_t containing an error code from pp_errors.h.

Definition at line 53 of file file_system.cc.

References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().


The documentation for this class was generated from the following files: