Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: ppapi/cpp/directory_entry.h

Issue 14419003: PPAPI: Move PPB_DirectoryReader_Dev to stable (won't commit) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/dev/file_chooser_dev.h ('k') | ppapi/cpp/directory_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/directory_entry.h
diff --git a/ppapi/cpp/directory_entry.h b/ppapi/cpp/directory_entry.h
new file mode 100644
index 0000000000000000000000000000000000000000..471568d05d1a2625e5f6ecc1dc5dbdcddbdc318a
--- /dev/null
+++ b/ppapi/cpp/directory_entry.h
@@ -0,0 +1,76 @@
+// Copyright (c) 2011 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_DIRECTORY_ENTRY_H_
+#define PPAPI_CPP_DIRECTORY_ENTRY_H_
+
+#include "ppapi/c/ppb_directory_reader.h"
+#include "ppapi/cpp/file_ref.h"
+
+/// @file
+/// This file defines the API used to handle a directory entry.
+
+namespace pp {
+
+/// The <code>DirectoryEntry</code> class represents information about a
+/// directory entry.
+class DirectoryEntry {
+ public:
+ /// Default constructor for creating an is_null() <code>DirectoryEntry</code>
+ /// object.
+ DirectoryEntry();
+
+ /// A constructor used when you have a <code>PP_DirectoryEntry</code> which
+ /// contains a <code>FileRef</code> that has already been reference counted
+ /// as a return value.
+ ///
+ /// @param[in] data A <code>PP_DirectoryEntry</code> to be copied.
+ DirectoryEntry(PassRef, const PP_DirectoryEntry& data);
+
+ /// A copy constructor for <code>DirectoryEntry</code>. This constructor
+ /// increments a reference count of the <code>FileRef</code> held by this
+ /// DirectoryEntry.
+ ///
+ /// @param[in] other A pointer to a <code>DirectoryEntry</code>.
+ DirectoryEntry(const DirectoryEntry& other);
+
+ /// A destructor that decrements a reference count of the <code>FileRef</code>
+ /// held by this <code>DirectoryEntry</code>.
+ ~DirectoryEntry();
+
+ /// This function assigns one <code>DirectoryEntry</code> object to this
+ /// <code>DirectoryEntry</code> object. This function increases the reference
+ /// count of the <code>FileRef</code> of the other DirectoryEntry while
+ /// decrementing the reference count of the FileRef of this DirectoryEntry.
+ ///
+ /// @param[in] other A pointer to a <code>DirectoryEntry</code>.
+ ///
+ /// @return A new <code>DirectoryEntry</code> object.
+ DirectoryEntry& operator=(const DirectoryEntry& other);
+
+ /// This function determines if this <code>DirectoryEntry</code> is a null
+ /// value.
+ ///
+ /// @return true if this <code>DirectoryEntry</code> is null, otherwise false.
+ bool is_null() const { return !data_.file_ref; }
+
+ /// This function returns the <code>FileRef</code> held by this
+ /// <code>DirectoryEntry</code>.
+ ///
+ /// @return A <code>FileRef</code> of the file.
+ FileRef file_ref() const { return FileRef(data_.file_ref); }
+
+ /// This function returns the <code>PP_FileType</code> of the file referenced
+ /// by this <code>DirectoryEntry</code>.
+ ///
+ /// @return A <code>PP_FileType</code> of the file.
+ PP_FileType file_type() const { return data_.file_type; }
+
+ private:
+ PP_DirectoryEntry data_;
+};
+
+} // namespace pp
+
+#endif // PPAPI_CPP_DIRECTORY_ENTRY_H_
« no previous file with comments | « ppapi/cpp/dev/file_chooser_dev.h ('k') | ppapi/cpp/directory_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698