forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
string_traits_string16.h
37 lines (27 loc) · 1.19 KB
/
string_traits_string16.h
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
// Copyright 2016 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 MOJO_PUBLIC_CPP_BINDINGS_STRING_TRAITS_STRING16_H_
#define MOJO_PUBLIC_CPP_BINDINGS_STRING_TRAITS_STRING16_H_
#include "base/strings/string16.h"
#include "mojo/public/cpp/bindings/bindings_export.h"
#include "mojo/public/cpp/bindings/string_traits.h"
namespace mojo {
template <>
struct MOJO_CPP_BINDINGS_EXPORT StringTraits<base::string16> {
static bool IsNull(const base::string16& input) {
// base::string16 is always converted to non-null mojom string.
return false;
}
static void SetToNull(base::string16* output) {
// Convert null to an "empty" base::string16.
output->clear();
}
static void* SetUpContext(const base::string16& input);
static void TearDownContext(const base::string16& input, void* context);
static size_t GetSize(const base::string16& input, void* context);
static const char* GetData(const base::string16& input, void* context);
static bool Read(StringDataView input, base::string16* output);
};
} // namespace mojo
#endif // MOJO_PUBLIC_CPP_BINDINGS_STRING_TRAITS_STRING16_H_