30 bool ParseHeader (
const NTV2Buffer & inHdrBuffer,
31 std::ostream & outMsgs);
35 inline const std::string &
Date (
void)
const {
return mDate;}
36 inline const std::string &
Time (
void)
const {
return mTime;}
37 inline const std::string &
PartName (
void)
const {
return mPartName;}
38 inline const std::string &
RawDesign (
void)
const {
return mRawDesignName;}
39 std::string DesignName (
void)
const;
47 inline bool IsValid (
void)
const {
return mValid;}
48 inline bool IsTandem (
void)
const {
return RawDesign().find(
"TANDEM=TRUE") != std::string::npos;}
49 inline bool IsPartial (
void)
const {
return RawDesign().find(
"PARTIAL=TRUE") != std::string::npos;}
50 inline bool IsClear (
void)
const {
return RawDesign().find(
"CLEAR=TRUE") != std::string::npos;}
51 inline bool IsCompress (
void)
const {
return RawDesign().find(
"COMPRESS=TRUE") != std::string::npos;}
60 bool SetRawDesign (
const std::string & inStr, std::ostream & oss);
61 bool SetDate (
const std::string & inStr, std::ostream & oss);
62 bool SetTime (
const std::string & inStr, std::ostream & oss);
63 inline void SetPartName (
const std::string & inStr) {mPartName = inStr;}
64 bool SetProgramOffsetBytes (
const ULWord inValue, std::ostream & oss);
65 bool SetProgramSizeBytes (
const ULWord inValue, std::ostream & oss);
70 std::string mPartName;
71 std::string mRawDesignName;
104 virtual bool Open (
const std::string & inBitfilePath);
109 virtual void Close (
void);
117 virtual std::string ParseHeaderFromBuffer (
const uint8_t* inBitfileBuffer,
const size_t inBufferSize);
124 virtual std::string ParseHeaderFromBuffer (
const NTV2Buffer & inBitfileBuffer);
129 virtual inline const std::string &
GetDate (
void)
const {
return mHeaderParser.Date();}
134 virtual inline const std::string &
GetTime (
void)
const {
return mHeaderParser.Time();}
139 virtual inline std::string
GetDesignName (
void)
const {
return mHeaderParser.DesignName();}
144 virtual inline const std::string &
GetPartName (
void)
const {
return mHeaderParser.PartName();}
149 virtual inline const std::string &
GetLastError (
void)
const {
return mLastError; }
154 virtual inline bool IsTandem (
void)
const {
return mHeaderParser.IsTandem();}
159 virtual inline bool IsPartial (
void)
const {
return mHeaderParser.IsPartial();}
164 virtual inline bool IsClear (
void)
const {
return mHeaderParser.IsClear();}
169 virtual inline bool IsCompress (
void)
const {
return mHeaderParser.IsCompress();}
200 virtual bool CanFlashDevice (
const NTV2DeviceID inDeviceID)
const;
210 virtual inline size_t GetProgramStreamLength (
void)
const {
return mReady ? size_t(mHeaderParser.ProgramSizeBytes()) : 0;}
223 virtual size_t GetProgramByteStream (
NTV2Buffer & outBuffer);
231 virtual size_t GetFileByteStream (
NTV2Buffer & outBuffer);
237 static std::string GetPrimaryHardwareDesignName (
const NTV2DeviceID inDeviceID);
238 static NTV2DeviceID GetDeviceIDFromHardwareDesignName (
const std::string & inDesignName);
241 virtual void SetLastError (
const std::string & inStr,
const bool inAppend =
false);
244 std::ifstream mFileStream;
247 std::string mLastError;
252 #endif // NTV2BITFILE_H