file_utils.h 1.3 KB

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