From 7853a74932791f7760961ddeb3a6064721eeb8b4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 28 Sep 2008 23:53:01 +0000 Subject: Move util functions into utils/ module --- src/utils/version.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/utils/version.cpp (limited to 'src/utils/version.cpp') diff --git a/src/utils/version.cpp b/src/utils/version.cpp new file mode 100644 index 000000000..09deb53d6 --- /dev/null +++ b/src/utils/version.cpp @@ -0,0 +1,28 @@ +/************************************************* +* Version Information Source File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#include +#include + +namespace Botan { + +/************************************************* +* Return the version as a string * +*************************************************/ +std::string version_string() + { + return "Botan " + to_string(version_major()) + "." + + to_string(version_minor()) + "." + + to_string(version_patch()); + } + +/************************************************* +* Return parts of the version as integers * +*************************************************/ +u32bit version_major() { return BOTAN_VERSION_MAJOR; } +u32bit version_minor() { return BOTAN_VERSION_MINOR; } +u32bit version_patch() { return BOTAN_VERSION_PATCH; } + +} -- cgit v1.2.3