Newer
Older
Russell Taylor
committed
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidKernel/EnvironmentHistory.h"
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/MantidVersion.h"
Russell Taylor
committed
namespace Mantid
{
Gigg, Martyn Anthony
committed
namespace Kernel
{
Russell Taylor
committed
Gigg, Martyn Anthony
committed
/**
* Returns the framework version
* @returns A string containing the Mantid version
*/
std::string EnvironmentHistory::frameworkVersion() const
{
Russell Taylor
committed
return MantidVersion::version();
Gigg, Martyn Anthony
committed
}
/**
* Returns the OS name
* @returns A string containing the OS name
*/
std::string EnvironmentHistory::osName() const
{
return ConfigService::Instance().getOSName();
}
/**
* Returns the OS version
* @returns A string containing the OS version
*/
std::string EnvironmentHistory::osVersion() const
{
return ConfigService::Instance().getOSVersion();
}
Russell Taylor
committed
Gigg, Martyn Anthony
committed
/** Prints a text representation of itself
* @param os :: The ouput stream to write to
* @param indent :: an indentation value to make pretty printing of object and sub-objects
*/
void EnvironmentHistory::printSelf(std::ostream& os, const int indent) const
{
Russell Taylor
committed
os << std::string(indent,' ') << "Framework Version: " << frameworkVersion() << std::endl;
Gigg, Martyn Anthony
committed
os << std::string(indent,' ') << "OS name: " << osName() << std::endl;
os << std::string(indent,' ') << "OS version: " << osVersion() << std::endl;
}
Russell Taylor
committed
Gigg, Martyn Anthony
committed
/** Prints a text representation
* @param os :: The ouput stream to write to
* @param EH :: The EnvironmentHistory to output
* @returns The ouput stream
*/
std::ostream& operator<<(std::ostream& os, const EnvironmentHistory& EH)
{
EH.printSelf(os);
return os;
}
Russell Taylor
committed
Gigg, Martyn Anthony
committed
} // namespace Kernel
Russell Taylor
committed
} // namespace Mantid