1*993229b6Sjkunz /* 2*993229b6Sjkunz * File: BootImage.h 3*993229b6Sjkunz * 4*993229b6Sjkunz * Copyright (c) Freescale Semiconductor, Inc. All rights reserved. 5*993229b6Sjkunz * See included license file for license details. 6*993229b6Sjkunz */ 7*993229b6Sjkunz #if !defined(_BootImage_h_) 8*993229b6Sjkunz #define _BootImage_h_ 9*993229b6Sjkunz 10*993229b6Sjkunz #include <iostream> 11*993229b6Sjkunz #include "Version.h" 12*993229b6Sjkunz 13*993229b6Sjkunz namespace elftosb 14*993229b6Sjkunz { 15*993229b6Sjkunz 16*993229b6Sjkunz /*! 17*993229b6Sjkunz * \brief Abstract base class for all boot image format classes. 18*993229b6Sjkunz * 19*993229b6Sjkunz * Provides virtual methods for all of the common features between different 20*993229b6Sjkunz * boot image formats. These are the product and component version numbers 21*993229b6Sjkunz * and the drive tag. 22*993229b6Sjkunz * 23*993229b6Sjkunz * Also provided is the virtual method writeToStream() that lets the caller 24*993229b6Sjkunz * stream out the boot image without knowing the underlying format type. 25*993229b6Sjkunz */ 26*993229b6Sjkunz class BootImage 27*993229b6Sjkunz { 28*993229b6Sjkunz public: 29*993229b6Sjkunz //! \brief Constructor. BootImage()30*993229b6Sjkunz BootImage() {} 31*993229b6Sjkunz 32*993229b6Sjkunz //! \brief Destructor. ~BootImage()33*993229b6Sjkunz virtual ~BootImage() {} 34*993229b6Sjkunz 35*993229b6Sjkunz //! \name Versions 36*993229b6Sjkunz //@{ 37*993229b6Sjkunz virtual void setProductVersion(const version_t & version)=0; 38*993229b6Sjkunz virtual void setComponentVersion(const version_t & version)=0; 39*993229b6Sjkunz //@} 40*993229b6Sjkunz 41*993229b6Sjkunz //! \brief Specify the drive tag to be set in the output file header. 42*993229b6Sjkunz virtual void setDriveTag(uint16_t tag)=0; 43*993229b6Sjkunz 44*993229b6Sjkunz //! \brief Returns a string containing the preferred file extension for image format. 45*993229b6Sjkunz virtual std::string getFileExtension() const=0; 46*993229b6Sjkunz 47*993229b6Sjkunz //! \brief Write the boot image to an output stream. 48*993229b6Sjkunz virtual void writeToStream(std::ostream & stream)=0; 49*993229b6Sjkunz }; 50*993229b6Sjkunz 51*993229b6Sjkunz }; // namespace elftosb 52*993229b6Sjkunz 53*993229b6Sjkunz #endif // _BootImage_h_ 54*993229b6Sjkunz 55