• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 #ifndef MOJO_PUBLIC_CPP_BASE_BIG_STRING_MOJOM_TRAITS_H_
6 #define MOJO_PUBLIC_CPP_BASE_BIG_STRING_MOJOM_TRAITS_H_
7 
8 #include <string>
9 
10 #include "base/component_export.h"
11 #include "mojo/public/cpp/base/big_buffer.h"
12 #include "mojo/public/cpp/bindings/struct_traits.h"
13 #include "mojo/public/mojom/base/big_string.mojom-shared.h"
14 
15 namespace mojo {
16 
17 template <>
COMPONENT_EXPORT(MOJO_BASE_MOJOM)18 struct COMPONENT_EXPORT(MOJO_BASE_MOJOM)
19     StructTraits<mojo_base::mojom::BigStringDataView, std::string> {
20   static mojo_base::BigBuffer data(const std::string& str);
21 
22   static bool Read(mojo_base::mojom::BigStringDataView data, std::string* out);
23 };
24 
25 }  // namespace mojo
26 
27 #endif  // MOJO_PUBLIC_CPP_BASE_BIG_STRING_MOJOM_TRAITS_H_
28