2021-06-26 15:24:07 +02:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2020-09-05 07:49:57 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2020 Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef SRC_RAWPARSER_HPP_
|
|
|
|
|
#define SRC_RAWPARSER_HPP_
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
#include "configBitstreamParser.hpp"
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* \file rawParser
|
|
|
|
|
* \class RawParser
|
|
|
|
|
* \brief class used to read a raw data file
|
|
|
|
|
* \author Gwenhael Goavec-Merou
|
|
|
|
|
*/
|
|
|
|
|
class RawParser: public ConfigBitstreamParser {
|
|
|
|
|
public:
|
|
|
|
|
/*!
|
|
|
|
|
* \brief constructor
|
|
|
|
|
* \param[in] filename: raw file to read
|
|
|
|
|
* \param[in] reverseOrder: reverse each byte (LSB -> MSB, MSB -> LSB)
|
|
|
|
|
*/
|
|
|
|
|
RawParser(const std::string &filename, bool reverseOrder);
|
|
|
|
|
/*!
|
|
|
|
|
* \brief read full content of the file, fill the buffer
|
2022-12-18 23:29:21 +01:00
|
|
|
* \return EXIT_SUCCESS is file is fully read, EXIT_FAILURE otherwise
|
2020-09-05 07:49:57 +02:00
|
|
|
*/
|
|
|
|
|
int parse() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool _reverseOrder; /*!< tail if byte must be reversed */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // SRC_RAWPARSER_HPP_
|
|
|
|
|
|