summaryrefslogtreecommitdiffstats
path: root/common/Version.h
blob: 9533586c5b90488b409828fa35495e15930f889a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * File:	Version.h
 *
 * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
 * See included license file for license details.
 */
#if !defined(_Version_h_)
#define _Version_h_

#include <string>
#include "stdafx.h"

namespace elftosb
{

//! Same version struct used for 3600 boot image.
struct version_t
{
	uint16_t m_major;
	uint16_t m_pad0;
	uint16_t m_minor;
	uint16_t m_pad1;
	uint16_t m_revision;
	uint16_t m_pad2;
	
	version_t()
	:	m_major(0x999), m_pad0(0), m_minor(0x999), m_pad1(0), m_revision(0x999), m_pad2(0)
	{
	}
	
	version_t(uint16_t maj, uint16_t min, uint16_t rev)
	:	m_major(maj), m_pad0(0), m_minor(min), m_pad1(0), m_revision(rev), m_pad2(0)
	{
	}
	
	version_t(const std::string & versionString)
	:	m_major(0x999), m_pad0(0), m_minor(0x999), m_pad1(0), m_revision(0x999), m_pad2(0)
	{
		set(versionString);
	}
	
	//! \brief Sets the version by parsing a string.
	void set(const std::string & versionString);

	//! \brief
	void fixByteOrder();
};

}; // namespace elftosb

#endif // _Version_h_