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 <absl/flags/flag.h>
11#include <absl/strings/ascii.h>
12#include <absl/strings/escaping.h>
13
14#include <packager/utils/hex_parser.h>
15
16// Custom flag type for hexadecimal byte array
17namespace shaka {
18
19struct HexBytes {
20 std::vector<uint8_t> bytes;
21};
22
23// Custom flag parser for HexBytes
24bool AbslParseFlag(absl::string_view text, HexBytes* flag, std::string* error);
25std::string AbslUnparseFlag(const HexBytes& flag);
26
27} // namespace shaka
28
29#endif // SHAKA_PACKAGER_ABSL_FLAG_HEXBYTES_H
All the methods that are virtual are virtual for mocking.