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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_FileSystemUtils_h
8 #define mozilla_dom_FileSystemUtils_h
16 #define FILESYSTEM_DOM_PATH_SEPARATOR_LITERAL "/"
17 #define FILESYSTEM_DOM_PATH_SEPARATOR_CHAR '/'
20 * This class is for error handling.
21 * All methods in this class are static.
23 class FileSystemUtils
{
26 * Return true if aDescendantPath is a descendant of aPath.
28 static bool IsDescendantPath(const nsAString
& aPath
,
29 const nsAString
& aDescendantPath
);
32 * Return true if this is valid DOMPath. It also splits the path in
33 * subdirectories and stores them in aParts.
35 static bool IsValidRelativeDOMPath(const nsAString
& aPath
,
36 nsTArray
<nsString
>& aParts
);
39 * Helper method. If aGlobal is null, the SystemGroup EventTarget will be
42 static nsresult
DispatchRunnable(nsIGlobalObject
* aGlobal
,
43 already_AddRefed
<nsIRunnable
>&& aRunnable
);
47 } // namespace mozilla
49 #endif // mozilla_dom_FileSystemUtils_h