1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_FileSystemBase_h
8 #define mozilla_dom_FileSystemBase_h
10 #include "nsAutoPtr.h"
23 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(FileSystemBase
)
26 // Create file system object from its string representation.
27 static already_AddRefed
<FileSystemBase
>
28 FromString(const nsAString
& aString
);
35 // Get the string representation of the file system.
42 virtual nsPIDOMWindow
*
46 * Create nsIFile object with the given real path (absolute DOM path).
48 virtual already_AddRefed
<nsIFile
>
49 GetLocalFile(const nsAString
& aRealPath
) const = 0;
52 * Get the virtual name of the root directory. This name will be exposed to
55 virtual const nsAString
&
56 GetRootName() const = 0;
65 IsSafeFile(nsIFile
* aFile
) const;
68 IsSafeDirectory(Directory
* aDir
) const;
71 * Get the real path (absolute DOM path) of the DOM file in the file system.
72 * If succeeded, returns true. Otherwise, returns false and set aRealPath to
76 GetRealPath(FileImpl
* aFile
, nsAString
& aRealPath
) const = 0;
79 * Get the permission name required to access this file system.
93 virtual ~FileSystemBase();
95 // The string representation of the file system.
100 // The permission name required to access the file system.
101 nsCString mPermission
;
107 } // namespace mozilla
109 #endif // mozilla_dom_FileSystemBase_h