File: mtp_file_entry.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (55 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download | duplicates (11)
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
// Copyright 2012 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

// This protobuf is for sending file entries from a mtp/ptp device to the
// browser.
message MtpFileEntry {
  // The id for the file on the mtp/ptp device.
  optional uint32 item_id = 1;

  // The id of this file's parent on the mtp/ptp device.
  optional uint32 parent_id = 2;

  // The file's name.
  optional string file_name = 3;

  // The file's size.
  optional uint64 file_size = 4;

  // The file's modification time. This is approximately the number of seconds
  // since Unix epoch. However, it does not account for timezone offsets or
  // daylight savings time.
  optional int64 modification_time = 5;

  // Values match libmtp values unless noted below.
  enum FileType {
    FILE_TYPE_FOLDER = 0;
    FILE_TYPE_JPEG = 14;
    FILE_TYPE_JFIF = 15;
    FILE_TYPE_TIFF = 16;
    FILE_TYPE_BMP = 17;
    FILE_TYPE_GIF = 18;
    FILE_TYPE_PICT = 19;
    FILE_TYPE_PNG = 20;
    FILE_TYPE_WINDOWSIMAGEFORMAT = 25;
    FILE_TYPE_JP2 = 40;
    FILE_TYPE_JPX = 41;
    // Truly unknown file type.
    FILE_TYPE_UNKNOWN = 44;
    // There's more file types to map to, but right now they are not
    // interesting. Just assign a dummy value for now.
    FILE_TYPE_OTHER = 9999;
  }

  // The file's type.
  optional FileType file_type = 6;
}

message MtpFileEntries {
  repeated MtpFileEntry file_entries = 1;
}