Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

eformat::helper::Version Class Reference

#include <Version.h>

List of all members.

Public Member Functions

uint32_t code (void) const
uint32_t code (void) const
std::string human (void) const
std::string human (void) const
std::string human_major (void) const
std::string human_major (void) const
std::string human_minor (void) const
std::string human_minor (void) const
uint16_t major2 (void) const
uint16_t major2 (void) const
uint16_t minor2 (void) const
uint16_t minor2 (void) const
 Version (uint32_t v=DEFAULT_VERSION)
 Version (uint16_t minor, uint16_t major=MAJOR_DEFAULT_VERSION)
 Version (uint32_t v=DEFAULT_VERSION)
 Version (uint16_t minor, uint16_t major=MAJOR_DEFAULT_VERSION)

Private Attributes

uint16_t m_major
 The major part of the version number.
uint16_t m_minor
 The minor part of the version number.


Detailed Description

Defines converters between version numbers and its components


Constructor & Destructor Documentation

eformat::helper::Version::Version uint16_t  minor,
uint16_t  major = MAJOR_DEFAULT_VERSION
[inline]
 

Constructor. Takes the components to form a version

Parameters:
minor The minor version
major The major version
00051         : m_minor(minor), m_major(major) {}

eformat::helper::Version::Version uint32_t  v = DEFAULT_VERSION  ) 
 

Constructor. Takes the version to understand the components from.

Parameters:
v The version number, fully built.
Warning:
This version number has to conform to the current version of the library or unpredictable results might occur.
00017   : m_minor(0xffff&v), m_major(v>>16)
00018 {
00019 }

eformat::helper::Version::Version uint16_t  minor,
uint16_t  major = MAJOR_DEFAULT_VERSION
[inline]
 

Constructor. Takes the components to form a version

Parameters:
minor The minor version
major The major version
00051         : m_minor(minor), m_major(major) {}

eformat::helper::Version::Version uint32_t  v = DEFAULT_VERSION  ) 
 

Constructor. Takes the version to understand the components from.

Parameters:
v The version number, fully built.
Warning:
This version number has to conform to the current version of the library or unpredictable results might occur.


Member Function Documentation

uint32_t eformat::helper::Version::code void   )  const
 

Gets the full 32-bit number made by assembling the 2 numbers above.

uint32_t eformat::helper::Version::code void   )  const
 

Gets the full 32-bit number made by assembling the 2 numbers above.

00022 {
00023   uint32_t retval = m_major;
00024   retval <<= 16;
00025   retval |= m_minor;
00026   return retval;
00027 }

std::string eformat::helper::Version::human void   )  const
 

Returns a string representation of the version number

std::string eformat::helper::Version::human void   )  const
 

Returns a string representation of the version number

00044 {
00045   std::string retval = human_major();
00046   retval += "-";
00047   retval += human_minor();
00048   return retval;
00049 }

std::string eformat::helper::Version::human_major void   )  const
 

Returns a string representation of the major version number

std::string eformat::helper::Version::human_major void   )  const
 

Returns a string representation of the major version number

00030 {
00031   std::ostringstream oss;
00032   oss << (major2() >> 8) << "." << (major2() & 0xff);
00033   return oss.str();
00034 }

std::string eformat::helper::Version::human_minor void   )  const
 

Returns a string representation of the minor version number

std::string eformat::helper::Version::human_minor void   )  const
 

Returns a string representation of the minor version number

00037 {
00038   std::ostringstream oss;
00039   oss << (minor2() >> 8) << "." << (minor2() & 0xff);
00040   return oss.str();
00041 }

uint16_t eformat::helper::Version::major2 void   )  const [inline]
 

Extracts the major version part of this version

00065 { return m_major; }

uint16_t eformat::helper::Version::major2 void   )  const [inline]
 

Extracts the major version part of this version

00065 { return m_major; }

uint16_t eformat::helper::Version::minor2 void   )  const [inline]
 

Extracts the minor version part of this version

00070 { return m_minor; }

uint16_t eformat::helper::Version::minor2 void   )  const [inline]
 

Extracts the minor version part of this version

00070 { return m_minor; }


Member Data Documentation

uint16_t eformat::helper::Version::m_major [private]
 

The major part of the version number.

uint16_t eformat::helper::Version::m_minor [private]
 

The minor part of the version number.


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 19:18:46 2011 for BOSS6.5.5 by  doxygen 1.3.9.1