file_path_mojom_traits.h 801 B

123456789101112131415161718192021222324252627
  1. // Copyright 2020 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 ASH_COMPONENTS_SMBFS_FILE_PATH_MOJOM_TRAITS_H_
  5. #define ASH_COMPONENTS_SMBFS_FILE_PATH_MOJOM_TRAITS_H_
  6. #include <string>
  7. #include "ash/components/smbfs/mojom/file_path.mojom-shared.h"
  8. #include "base/files/file_path.h"
  9. #include "mojo/public/cpp/bindings/struct_traits.h"
  10. namespace mojo {
  11. template <>
  12. struct StructTraits<smbfs::mojom::FilePathDataView, base::FilePath> {
  13. static const std::string& path(const base::FilePath& path) {
  14. return path.value();
  15. }
  16. static bool Read(smbfs::mojom::FilePathDataView data, base::FilePath* out);
  17. };
  18. } // namespace mojo
  19. #endif // ASH_COMPONENTS_SMBFS_FILE_PATH_MOJOM_TRAITS_H_