summaryrefslogtreecommitdiffstats
path: root/ppapi/c/dev/ppb_directory_reader_dev.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 16:16:50 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 16:16:50 +0000
commit1758e88fd909ea0ffd49621e8066ffad5627ffdf (patch)
treec304a5eed047cae5665f5af1739d84655fb5815d /ppapi/c/dev/ppb_directory_reader_dev.h
parente7d8b51953b7d3b2b8a0aba46132305b32f3efce (diff)
downloadchromium_src-1758e88fd909ea0ffd49621e8066ffad5627ffdf.zip
chromium_src-1758e88fd909ea0ffd49621e8066ffad5627ffdf.tar.gz
chromium_src-1758e88fd909ea0ffd49621e8066ffad5627ffdf.tar.bz2
Move PPAPI into the Chrome repo. The old repo was
http://ppapi.googlecode.com/ TEST=none BUG=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c/dev/ppb_directory_reader_dev.h')
-rw-r--r--ppapi/c/dev/ppb_directory_reader_dev.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/ppapi/c/dev/ppb_directory_reader_dev.h b/ppapi/c/dev/ppb_directory_reader_dev.h
new file mode 100644
index 0000000..84983f5
--- /dev/null
+++ b/ppapi/c/dev/ppb_directory_reader_dev.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2010 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_C_DEV_PPB_DIRECTORY_READER_DEV_H_
+#define PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_
+
+#include "ppapi/c/dev/pp_file_info_dev.h"
+#include "ppapi/c/pp_module.h"
+#include "ppapi/c/pp_resource.h"
+
+struct PP_CompletionCallback;
+
+struct PP_DirectoryEntry_Dev {
+ PP_Resource file_ref;
+ PP_FileType_Dev file_type;
+};
+
+#define PPB_DIRECTORYREADER_DEV_INTERFACE "PPB_DirectoryReader(Dev);0.1"
+
+struct 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)(PP_Resource directory_ref);
+
+ // Returns true if the given resource is a DirectoryReader. Returns false if
+ // the resource is invalid or some type other than a DirectoryReader.
+ bool (*IsDirectoryReader)(PP_Resource resource);
+
+ // Reads the next entry in the directory. Return PP_OK and sets
+ // entry->file_ref to 0 to indicate reaching the end of the directory. If
+ // entry->file_ref is non-zero when passed to GetNextEntry, it will be
+ // released before the next file_ref is stored.
+ //
+ // EXAMPLE USAGE:
+ //
+ // PP_Resource reader = reader_funcs->Create(dir_ref);
+ // PP_DirectoryEntry entry = {0};
+ // while (reader_funcs->GetNextEntry(reader, &entry,
+ // PP_BlockUntilComplete()) == PP_OK) {
+ // ProcessDirectoryEntry(entry);
+ // }
+ // core_funcs->ReleaseResource(reader);
+ //
+ int32_t (*GetNextEntry)(PP_Resource directory_reader,
+ struct PP_DirectoryEntry_Dev* entry,
+ struct PP_CompletionCallback callback);
+};
+
+#endif // PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_