summaryrefslogtreecommitdiff
path: root/chromium/base/fuchsia/file_utils.h
blob: 8e3a197025865a05676159881a6b9503d2722d4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_FUCHSIA_FILE_UTILS_H_
#define BASE_FUCHSIA_FILE_UTILS_H_

#include <fuchsia/io/cpp/fidl.h>

#include "base/base_export.h"
#include "base/files/file_path.h"

namespace base {

// Persisted data directory, i.e. /data . Returned as DIR_APP_DATA from
// PathService.
BASE_EXPORT extern const char kPersistedDataDirectoryPath[];

// Persisted cache directory, i.e. /cache .
BASE_EXPORT extern const char kPersistedCacheDirectoryPath[];

// Services directory, i.e. /svc .
BASE_EXPORT extern const char kServiceDirectoryPath[];

// Package root directory, i.e. /pkg .
BASE_EXPORT extern const char kPackageRootDirectoryPath[];

// Returns fuchsia.io.Directory for the specified |path| or null InterfaceHandle
// if the path doesn't exist or it's not a directory.
BASE_EXPORT fidl::InterfaceHandle<::fuchsia::io::Directory> OpenDirectoryHandle(
    const base::FilePath& path);

// TODO(crbug.com/1073821): Remove this block when out-of-tree callers have been
// changed to use the non-fuchsia-sub-namespace version.
namespace fuchsia {

BASE_EXPORT extern const char kPersistedDataDirectoryPath[];
BASE_EXPORT extern const char kPersistedCacheDirectoryPath[];
BASE_EXPORT extern const char kServiceDirectoryPath[];
BASE_EXPORT extern const char kPackageRootDirectoryPath[];
BASE_EXPORT fidl::InterfaceHandle<::fuchsia::io::Directory> OpenDirectory(
    const base::FilePath& path);

}  // namespace fuchsia

}  // namespace base

#endif  // BASE_FUCHSIA_FILE_UTILS_H_