From 74a8b86758a4a0b1c8a6471a13ebcf94fe24343e Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 8 Mar 2007 00:28:01 +0000 Subject: Move the version query code out of base.cpp and into version.cpp; I have a feeling I may want to perform automated source changes to the version strings (eg, to insert a monotone revision ID), but I'd just as soon perform such operations on as small a file as possible to limit any damage that might occur due to a source code rewriting script gone awry. --- src/version.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/version.cpp (limited to 'src/version.cpp') diff --git a/src/version.cpp b/src/version.cpp new file mode 100644 index 000000000..372634b24 --- /dev/null +++ b/src/version.cpp @@ -0,0 +1,28 @@ +/************************************************* +* Version Information Source File * +* (C) 1999-2007 The Botan Project * +*************************************************/ + +#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