Shaka Packager SDK
Loading...
Searching...
No Matches
absl_flag_hexbytes.h
1// Copyright 2023 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#ifndef SHAKA_PACKAGER_ABSL_FLAG_HEXBYTES_H
8#define SHAKA_PACKAGER_ABSL_FLAG_HEXBYTES_H
9
10#include <cstdint>
11
12#include <absl/flags/flag.h>
13#include <absl/strings/ascii.h>
14#include <absl/strings/escaping.h>
15
16#include <packager/utils/hex_parser.h>
17
18// Custom flag type for hexadecimal byte array
19namespace shaka {
20
21struct HexBytes {
22 std::vector<uint8_t> bytes;
23};
24
25// Custom flag parser for HexBytes
26bool AbslParseFlag(absl::string_view text, HexBytes* flag, std::string* error);
27std::string AbslUnparseFlag(const HexBytes& flag);
28
29} // namespace shaka
30
31#endif // SHAKA_PACKAGER_ABSL_FLAG_HEXBYTES_H
All the methods that are virtual are virtual for mocking.