2023-08-31 23:59:46 +00:00
|
|
|
// Copyright 2023 Google LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
|
|
|
#ifndef SHAKA_PACKAGER_ABSL_FLAG_HEXBYTES_H
|
|
|
|
#define SHAKA_PACKAGER_ABSL_FLAG_HEXBYTES_H
|
|
|
|
|
2023-10-09 23:21:41 +00:00
|
|
|
#include <absl/flags/flag.h>
|
|
|
|
#include <absl/strings/ascii.h>
|
|
|
|
#include <absl/strings/escaping.h>
|
2023-08-31 23:59:46 +00:00
|
|
|
|
2023-10-11 08:49:50 +00:00
|
|
|
#include <packager/utils/hex_parser.h>
|
|
|
|
|
2023-08-31 23:59:46 +00:00
|
|
|
// Custom flag type for hexadecimal byte array
|
|
|
|
namespace shaka {
|
|
|
|
|
|
|
|
struct HexBytes {
|
|
|
|
std::vector<uint8_t> bytes;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Custom flag parser for HexBytes
|
|
|
|
bool AbslParseFlag(absl::string_view text, HexBytes* flag, std::string* error);
|
|
|
|
std::string AbslUnparseFlag(const HexBytes& flag);
|
|
|
|
|
|
|
|
} // namespace shaka
|
|
|
|
|
|
|
|
#endif // SHAKA_PACKAGER_ABSL_FLAG_HEXBYTES_H
|