Commit 23df36dc authored by Bart van der Velden's avatar Bart van der Velden

Add comments (#53)

parent c57f2aee
......@@ -17,28 +17,32 @@
#include "version.h"
// The following defines are filled in by the CMake script
#define VERSION_MAJOR "@MUSICCOLLECTION_VERSION_MAJOR@"
#define VERSION_MINOR "@MUSICCOLLECTION_VERSION_MINOR@"
#define VERSION_GITSHA1 "@MUSICCOLLECTION_VERSION_GITSHA1@"
// Construct a Version object which gives access to current version information
Version::Version()
{
m_majorVersion = VERSION_MAJOR;
m_minorVersion = VERSION_MINOR;
m_gitSha1 = VERSION_GITSHA1;
}
// Retrieve the major version number
const char* Version::GetMajor() const
{
return m_majorVersion.c_str();
}
// Retrieve the minor version number
const char* Version::GetMinor() const
{
return m_minorVersion.c_str();
}
// Retrieve the git SHA1 hash for the current tree
const char* Version::GetGitSha1() const
{
return m_gitSha1.c_str();
......
......@@ -16,7 +16,7 @@
*****************************************************************************/
/*!
* \brief Make the versio information available to the rest of the software
* \brief Make the version information available to the rest of the software
*/
#ifndef MUSICCOLLECTION_VERSION_H_INCLUDED
......@@ -24,18 +24,33 @@
#include <string>
//! Version gives access to the version of the software that is currently being built
/*! The implementation of Version is generated by CMake when a build starts. The CMake script
* picks up the major and minor version as defined in the src/CMakeLists.txt file together with
* the SHA1 hash for the Git commit we are now on
*/
class Version
{
public:
//! Construct a Version object
Version();
//! Retrieve the major version number
const char* GetMajor() const;
//! Retrieve the minor version number
const char* GetMinor() const;
//! Retrieve the git SHA1 hash for the current tree
const char* GetGitSha1() const;
private:
std::string m_majorVersion;
std::string m_minorVersion;
std::string m_gitSha1;
// Not implemented
Version(const Version&);
Version& operator=(const Version&);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment