aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/version.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/version.cpp')
-rw-r--r--src/utils/version.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/utils/version.cpp b/src/utils/version.cpp
index ce2083bc0..cf3205d19 100644
--- a/src/utils/version.cpp
+++ b/src/utils/version.cpp
@@ -1,12 +1,13 @@
/*
* Version Information
-* (C) 1999-2007 Jack Lloyd
+* (C) 1999-2011 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#include <botan/version.h>
#include <botan/parsing.h>
+#include <sstream>
namespace Botan {
@@ -21,9 +22,20 @@ namespace Botan {
*/
std::string version_string()
{
- return std::to_string(version_major()) + "." +
- std::to_string(version_minor()) + "." +
- std::to_string(version_patch());
+ std::ostringstream out;
+
+ out << "Botan " << version_major() << "."
+ << version_minor() << "."
+ << version_patch() << " (";
+
+ if(BOTAN_VERSION_DATESTAMP == 0)
+ out << "unreleased version";
+ else
+ out << "released " << version_datestamp();
+
+ out << ", distribution " << BOTAN_DISTRIBUTION_INFO << ")";
+
+ return out.str();
}
u32bit version_datestamp() { return BOTAN_VERSION_DATESTAMP; }