summaryrefslogtreecommitdiff
path: root/chromium/fuchsia/base/string_util.h
blob: 377444939dab458a05f0d20580ec3319b9a5e188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2019 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 FUCHSIA_BASE_STRING_UTIL_H_
#define FUCHSIA_BASE_STRING_UTIL_H_

#include <cstdint>
#include <vector>

#include "base/containers/span.h"
#include "base/strings/string_piece.h"

namespace cr_fuchsia {

// Creates a byte vector from a string.
std::vector<uint8_t> StringToBytes(base::StringPiece str);

// Creates a string from a byte vector.
base::StringPiece BytesAsString(const std::vector<uint8_t>& bytes);

}  // namespace cr_fuchsia

#endif  // FUCHSIA_BASE_STRING_UTIL_H_