Merge mozilla-central to autoland. CLOSED TREE
[gecko.git] / xpcom / io / nsILocalFileWin.idl
blob1195e2aa5851eaaa3938ccd49dbd138303b5099f
1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
7 #include "nsIFile.idl"
9 %{C++
10 struct PRFileDesc;
13 [ptr] native PRFileDescStar(PRFileDesc);
15 [scriptable, builtinclass, uuid(e7a3a954-384b-4aeb-a5f7-55626b0de9be)]
16 interface nsILocalFileWin : nsIFile
18 /**
19 * initWithCommandLine
21 * Initialize this object based on the main app path of a commandline
22 * handler.
24 * @param aCommandLine
25 * the commandline to parse an app path out of.
27 void initWithCommandLine(in AString aCommandLine);
28 /**
29 * getVersionInfoValue
31 * Retrieve a metadata field from the file's VERSIONINFO block.
32 * Throws NS_ERROR_FAILURE if no value is found, or the value is empty.
34 * @param aField The field to look up.
37 AString getVersionInfoField(in string aField);
39 /**
40 * The canonical path of the file, which avoids short/long
41 * pathname inconsistencies. The nsIFile persistent
42 * descriptor is not guaranteed to be canonicalized (it may
43 * persist either the long or the short path name). The format of
44 * the canonical path will vary with the underlying file system:
45 * it will typically be the short pathname on filesystems that
46 * support both short and long path forms.
48 [noscript] readonly attribute AString canonicalPath;
50 /**
51 * Get or set whether this file is marked read-only.
53 * Throws NS_ERROR_FILE_INVALID_PATH for an invalid file.
54 * Throws NS_ERROR_FAILURE if the set or get fails.
56 attribute boolean readOnly;
58 /**
59 * Setting this to true will prepend the prefix "\\?\" to all parsed file
60 * paths which match ^[A-Za-z]:\\.* (regex) syntax.
62 * There are two known issues (and potentially more) which can be resolved
63 * by the prefix:
64 * - In the Windows API, the maximum length for a path is MAX_PATH in
65 * general. However, Windows API has many functions that also have Unicode
66 * versions to permit an extended-length path for a maximum total path
67 * length of 32,767 characters.
69 * - A path component which ends with a dot is not allowed for Windows
70 * API.
72 * If either of these issues are expected to be common in your code, you
73 * should set this flag to true. (You should probably not have to set this
74 * flag to true.)
76 attribute boolean useDOSDevicePathSyntax;
78 /**
79 * Identical to nsIFile::openNSPRFileDesc except it also uses the
80 * FILE_SHARE_DELETE flag.
82 [noscript] PRFileDescStar openNSPRFileDescShareDelete(in long flags,
83 in long mode);
85 /**
86 * Return the Windows-specific file attributes of this file.
88 [noscript] unsigned long getWindowsFileAttributes();
90 /**
91 * Set or clear the Windows specific file attributes of this file.
93 * @param aSetAttrs Attribute to set on the file.
94 * @param aClearAttrs Attributes to clear on the file.
96 [noscript] void setWindowsFileAttributes(in unsigned long aSetAttrs,
97 in unsigned long aClearAttrs);