dom/filesystem/FileSystemUtils.h

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     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 "/"
    17 /*
    18  * This class is for error handling.
    19  * All methods in this class are static.
    20  */
    21 class FileSystemUtils
    22 {
    23 public:
    24   /*
    25    * Convert the path separator to "/".
    26    */
    27   static void
    28   LocalPathToNormalizedPath(const nsAString& aLocal, nsAString& aNorm);
    30   /*
    31    * Convert the normalized path separator "/" to the system dependent path
    32    * separator, which is "/" on Mac and Linux, and "\" on Windows.
    33    */
    34   static void
    35   NormalizedPathToLocalPath(const nsAString& aNorm, nsAString& aLocal);
    37   /*
    38    * Return true if aDescendantPath is a descendant of aPath. Both aPath and
    39    * aDescendantPath are absolute DOM path.
    40    */
    41   static bool
    42   IsDescendantPath(const nsAString& aPath, const nsAString& aDescendantPath);
    44   static bool
    45   IsParentProcess();
    47   static const char16_t kSeparatorChar = char16_t('/');
    48 };
    50 } // namespace dom
    51 } // namespace mozilla
    53 #endif // mozilla_dom_FileSystemUtils_h

mercurial