summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/dev/directory_entry_dev.h
blob: 6b91ebfc83f2fa2e5836c74b56f74611a171cbea (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
// 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_DEV_DIRECTORY_ENTRY_DEV_H_
#define PPAPI_CPP_DEV_DIRECTORY_ENTRY_DEV_H_

#include "ppapi/c/dev/ppb_directory_reader_dev.h"
#include "ppapi/cpp/file_ref.h"

namespace pp {

class DirectoryEntry_Dev {
 public:
  DirectoryEntry_Dev();
  DirectoryEntry_Dev(const DirectoryEntry_Dev& other);
  ~DirectoryEntry_Dev();

  DirectoryEntry_Dev& operator=(const DirectoryEntry_Dev& other);

  // Returns true if the DirectoryEntry is invalid or uninitialized.
  bool is_null() const { return !data_.file_ref; }

  // Returns the FileRef held by this DirectoryEntry.
  FileRef file_ref() const { return FileRef(data_.file_ref); }

  // Returns the type of the file referenced by this DirectoryEntry.
  PP_FileType file_type() const { return data_.file_type; }

 private:
  friend class DirectoryReader_Dev;
  PP_DirectoryEntry_Dev data_;
};

}  // namespace pp

#endif  // PPAPI_CPP_DEV_DIRECTORY_ENTRY_DEV_H_