summaryrefslogtreecommitdiffstats
path: root/ppapi/api/dev/ppb_directory_reader_dev.idl
blob: 5ba6065c0eef58127ce03b6efe05c8f4ee3756ea (plain)
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
/* 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.
 */

/*
 * This file defines the <code>PPB_DirectoryReader_Dev</code> interface.
 */

label Chrome {
  M27 = 0.6
};

[assert_size(8)]
struct PP_DirectoryEntry_Dev {
  PP_Resource file_ref;
  PP_FileType file_type;
};

interface PPB_DirectoryReader_Dev {
  // Creates a DirectoryReader for the given directory.  Upon success, the
  // corresponding directory is classified as "in use" by the resulting
  // DirectoryReader object until such time as the DirectoryReader object is
  // destroyed.
  PP_Resource Create([in] PP_Resource directory_ref);

  // Returns PP_TRUE if the given resource is a DirectoryReader. Returns
  // PP_FALSE if the resource is invalid or some type other than a
  // DirectoryReader.
  PP_Bool IsDirectoryReader([in] PP_Resource resource);

  // Reads all entries in the directory.
  //
  // @param[in] directory_reader A <code>PP_Resource</code>
  // corresponding to a directory reader resource.
  // @param[in] output An output array which will receive
  // <code>PP_DirectoryEntry_Dev</code> objects on success.
  // @param[in] callback A <code>PP_CompletionCallback</code> to run on
  // completion.
  //
  // @return An error code from <code>pp_errors.h</code>.
  //
  int32_t ReadEntries([in] PP_Resource directory_reader,
                      [in] PP_ArrayOutput output,
                      [in] PP_CompletionCallback callback);
};