blob: ba4056051ee6d7a802163c9b4fc4d8cbadf143b6 [file] [log] [blame]
QUICHE teamfd50a402018-12-07 22:54:05 -05001// Copyright 2017 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 QUICHE_HTTP2_PLATFORM_API_HTTP2_STRING_UTILS_H_
6#define QUICHE_HTTP2_PLATFORM_API_HTTP2_STRING_UTILS_H_
7
8#include <type_traits>
9#include <utility>
10
11#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
12#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
13#include "net/http2/platform/impl/http2_string_utils_impl.h"
14
15namespace http2 {
16
17template <typename... Args>
18inline Http2String Http2StrCat(const Args&... args) {
19 return Http2StrCatImpl(std::forward<const Args&>(args)...);
20}
21
22template <typename... Args>
23inline void Http2StrAppend(Http2String* output, const Args&... args) {
24 Http2StrAppendImpl(output, std::forward<const Args&>(args)...);
25}
26
27template <typename... Args>
28inline Http2String Http2StringPrintf(const Args&... args) {
29 return Http2StringPrintfImpl(std::forward<const Args&>(args)...);
30}
31
32inline Http2String Http2HexEncode(const void* bytes, size_t size) {
33 return Http2HexEncodeImpl(bytes, size);
34}
35
36inline Http2String Http2HexDecode(Http2StringPiece data) {
37 return Http2HexDecodeImpl(data);
38}
39
40inline Http2String Http2HexDump(Http2StringPiece data) {
41 return Http2HexDumpImpl(data);
42}
43
44inline Http2String Http2HexEscape(Http2StringPiece data) {
45 return Http2HexEscapeImpl(data);
46}
47
48template <typename Number>
49inline Http2String Http2Hex(Number number) {
50 static_assert(std::is_integral<Number>::value, "Number has to be an int");
51 return Http2HexImpl(number);
52}
53
54} // namespace http2
55
56#endif // QUICHE_HTTP2_PLATFORM_API_HTTP2_STRING_UTILS_H_