Bumping manifests a=b2g-bump
[gecko.git] / dom / filesystem / FileSystemUtils.h
blob474021255b4a510d53b1f2d9341613a6d8cdd7a4
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
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_FileSystemUtils_h
8 #define mozilla_dom_FileSystemUtils_h
10 #include "nsString.h"
12 namespace mozilla {
13 namespace dom {
15 #define FILESYSTEM_DOM_PATH_SEPARATOR "/"
18 * This class is for error handling.
19 * All methods in this class are static.
21 class FileSystemUtils
23 public:
25 * Convert the path separator to "/".
27 static void
28 LocalPathToNormalizedPath(const nsAString& aLocal, nsAString& aNorm);
31 * Convert the normalized path separator "/" to the system dependent path
32 * separator, which is "/" on Mac and Linux, and "\" on Windows.
34 static void
35 NormalizedPathToLocalPath(const nsAString& aNorm, nsAString& aLocal);
38 * Return true if aDescendantPath is a descendant of aPath. Both aPath and
39 * aDescendantPath are absolute DOM path.
41 static bool
42 IsDescendantPath(const nsAString& aPath, const nsAString& aDescendantPath);
44 static bool
45 IsParentProcess();
47 static const char16_t kSeparatorChar = char16_t('/');
50 } // namespace dom
51 } // namespace mozilla
53 #endif // mozilla_dom_FileSystemUtils_h