summaryrefslogtreecommitdiffstats
path: root/ppapi/api/pp_file_info.idl
blob: b0fa373240db31a0c7c963055619d17cef0f83eb (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* 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 three enumerations for use in the PPAPI C file IO APIs.
 */

/**
 * The <code>PP_FileType</code> enum contains file type constants.
 */
[assert_size(4)]
enum PP_FileType {
  /** A regular file type */
  PP_FILETYPE_REGULAR = 0,
  /** A directory */
  PP_FILETYPE_DIRECTORY = 1,
  /** A catch-all for unidentified types */
  PP_FILETYPE_OTHER = 2
};

/**
 * The <code>PP_FileSystemType</code> enum contains file system type constants.
 */
[assert_size(4)]
enum PP_FileSystemType {
  /** For identified invalid return values */
  PP_FILESYSTEMTYPE_INVALID = 0,
  /** For external file system types */
  PP_FILESYSTEMTYPE_EXTERNAL = 1,
  /** For local persistant file system types */
  PP_FILESYSTEMTYPE_LOCALPERSISTENT = 2,
  /** For local temporary file system types */
  PP_FILESYSTEMTYPE_LOCALTEMPORARY = 3
};

/**
 * The <code>PP_FileInfo</code> struct represents all information about a file,
 * such as size, type, and creation time.
 */
[assert_size(40)]
struct PP_FileInfo {
  /** This value represents the size of the file measured in bytes */
  int64_t size;

  /**
   * This value represents the type of file as defined by the
   * <code>PP_FileType</code> enum
   */
  PP_FileType type;

  /**
   * This value represents the file system type of the file as defined by the
   * <code>PP_FileSystemType</code> enum.
   */
  PP_FileSystemType system_type;

  /**
   * This value represents the creation time of the file.
   */
  PP_Time creation_time;

  /**
   * This value represents the last time the file was accessed.
   */
  PP_Time last_access_time;

  /**
   * This value represents the last time the file was modified.
   */
  PP_Time last_modified_time;
};