1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef _nsLocalFileWIN_H_
8 #define _nsLocalFileWIN_H_
15 #include "nsIFactory.h"
16 #include "nsILocalFileWin.h"
17 #include "nsIHashable.h"
18 #include "nsIClassInfoImpl.h"
21 #include "mozilla/Attributes.h"
28 class nsLocalFile MOZ_FINAL
29 : public nsILocalFileWin
33 NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID
)
37 static nsresult
nsLocalFileConstructor(nsISupports
* aOuter
,
41 // nsISupports interface
42 NS_DECL_THREADSAFE_ISUPPORTS
47 // nsILocalFile interface
50 // nsILocalFileWin interface
51 NS_DECL_NSILOCALFILEWIN
53 // nsIHashable interface
57 static void GlobalInit();
58 static void GlobalShutdown();
61 // CopyMove and CopySingleFile constants for |options| parameter:
63 FollowSymlinks
= 1u << 0,
65 SkipNtfsAclReset
= 1u << 2,
69 nsLocalFile(const nsLocalFile
& aOther
);
74 bool mDirty
; // cached information can only be used when this is false
76 bool mFollowSymlinks
; // should we follow symlinks when working on this file
78 // this string will always be in native format!
79 nsString mWorkingPath
;
81 // this will be the resolved path of shortcuts, it will *NEVER*
82 // be returned to the user
83 nsString mResolvedPath
;
85 // this string, if not empty, is the *short* pathname that represents
87 nsString mShortWorkingPath
;
89 PRFileInfo64 mFileInfo64
;
95 mShortWorkingPath
.Truncate();
98 nsresult
ResolveAndStat();
100 nsresult
ResolveShortcut();
102 void EnsureShortPath();
104 nsresult
CopyMove(nsIFile
* aNewParentDir
, const nsAString
& aNewName
,
106 nsresult
CopySingleFile(nsIFile
* aSource
, nsIFile
* aDest
,
107 const nsAString
& aNewName
, uint32_t aOptions
);
109 nsresult
SetModDate(int64_t aLastModifiedTime
, const wchar_t* aFilePath
);
110 nsresult
HasFileAttribute(DWORD aFileAttrib
, bool* aResult
);
111 nsresult
AppendInternal(const nsAFlatString
& aNode
,
112 bool aMultipleComponents
);