xref: /aosp_15_r20/external/cronet/base/fuchsia/file_utils.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BASE_FUCHSIA_FILE_UTILS_H_
6 #define BASE_FUCHSIA_FILE_UTILS_H_
7 
8 #include <fuchsia/io/cpp/fidl.h>
9 
10 #include "base/base_export.h"
11 #include "base/files/file_path.h"
12 
13 namespace base {
14 
15 // Persisted data directory, i.e. /data .
16 BASE_EXPORT extern const char kPersistedDataDirectoryPath[];
17 
18 // Persisted cache directory, i.e. /cache .
19 BASE_EXPORT extern const char kPersistedCacheDirectoryPath[];
20 
21 // Services directory, i.e. /svc .
22 BASE_EXPORT extern const char kServiceDirectoryPath[];
23 
24 // Package root directory, i.e. /pkg .
25 BASE_EXPORT extern const char kPackageRootDirectoryPath[];
26 
27 // Returns a read-only fuchsia.io.Directory for the specified |path|, or an
28 // invalid InterfaceHandle if the path doesn't exist or it's not a directory.
29 BASE_EXPORT fidl::InterfaceHandle<::fuchsia::io::Directory> OpenDirectoryHandle(
30     const base::FilePath& path);
31 
32 // Returns a write-capable fuchsia.io.Directory for the specified |path| or
33 // an invalid InterfaceHandle if the path doesn't exist or it's not a directory.
34 BASE_EXPORT fidl::InterfaceHandle<::fuchsia::io::Directory>
35 OpenWritableDirectoryHandle(const base::FilePath& path);
36 
37 }  // namespace base
38 
39 #endif  // BASE_FUCHSIA_FILE_UTILS_H_
40