summaryrefslogtreecommitdiffstats
path: root/dom/webidl/NativeOSFileInternals.webidl
blob: 27522a366cc567e274c04b1192bd79b62dfeb43e (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
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtaone at http://mozilla.org/MPL/2.0/. */

/**
 * Options for nsINativeOSFileInternals::Read
 */
[GenerateInit]
dictionary NativeOSFileReadOptions
{
  /**
   * If specified, convert the raw bytes to a String
   * with the specified encoding. Otherwise, return
   * the raw bytes as a TypedArray.
   */
  DOMString? encoding;

  /**
   * If specified, limit the number of bytes to read.
   */
  unsigned long long? bytes;
};

/**
 * Options for nsINativeOSFileInternals::WriteAtomic
 */
[GenerateInit]
dictionary NativeOSFileWriteAtomicOptions
{
  /**
   * If specified, specify the number of bytes to write.
   * NOTE: This takes (and should take) a uint64 here but the actual
   * value is limited to int32. This needs to be fixed, see Bug 1063635.
   */
  unsigned long long? bytes;

  /**
   * If specified, write all data to a temporary file in the
   * |tmpPath|. Else, write to the given path directly.
   */
  DOMString? tmpPath = null;

  /**
   * If specified and true, a failure will occur if the file
   * already exists in the given path.
   */
  boolean noOverwrite = false;

  /**
   * If specified and true, this will sync any buffered data
   * for the file to disk. This might be slower, but safer.
   */
  boolean flush = false;

  /**
   * If specified, this will backup the destination file as
   * specified.
   */
  DOMString? backupTo = null;
};