Bug 1610775 [wpt PR 21336] - Update urllib3 to 1.25.8, a=testonly
[gecko.git] / dom / filesystem / FileSystemUtils.h
blob13c43718e24904cbc6e856218d9820c4c9ab820f
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
10 class nsIFile;
11 class nsIRunnable;
13 namespace mozilla {
14 namespace dom {
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 {
24 public:
26 * Return true if aDescendantPath is a descendant of aPath.
28 static bool IsDescendantPath(const nsAString& aPath,
29 const nsAString& aDescendantPath);
31 /**
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);
38 /**
39 * Helper method. If aGlobal is null, the SystemGroup EventTarget will be
40 * used.
42 static nsresult DispatchRunnable(nsIGlobalObject* aGlobal,
43 already_AddRefed<nsIRunnable>&& aRunnable);
46 } // namespace dom
47 } // namespace mozilla
49 #endif // mozilla_dom_FileSystemUtils_h