2020-02-08 22:56:19 +01:00
|
|
|
/*
|
2022-11-07 13:04:52 +00:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-02-08 22:56:19 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/device_binary_format/ar/ar.h"
|
|
|
|
|
#include "shared/source/utilities/arrayref.h"
|
|
|
|
|
#include "shared/source/utilities/const_stringref.h"
|
2020-02-08 22:56:19 +01:00
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
namespace Ar {
|
|
|
|
|
|
|
|
|
|
struct ArEncoder {
|
2020-02-09 18:27:49 +01:00
|
|
|
ArEncoder(bool padTo8Bytes = false) : padTo8Bytes(padTo8Bytes) {}
|
2020-02-08 22:56:19 +01:00
|
|
|
ArFileEntryHeader *appendFileEntry(const ConstStringRef fileName, const ArrayRef<const uint8_t> fileData);
|
|
|
|
|
std::vector<uint8_t> encode() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
std::vector<uint8_t> fileEntries;
|
2020-02-09 18:27:49 +01:00
|
|
|
bool padTo8Bytes = false;
|
|
|
|
|
uint32_t paddingEntry = 0U;
|
2020-02-08 22:56:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Ar
|
|
|
|
|
|
|
|
|
|
} // namespace NEO
|