diff options
| author | Martin Hořeňovský | 2017-07-06 22:28:42 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2017-07-06 22:28:42 +0200 |
| commit | fc32165d48f0a46a60ac02e0e52f8c89adafd8be (patch) | |
| tree | acf2c6dc020615db581ce425b7ce0a424d801f83 /include/internal/catch_version.cpp | |
| parent | 0016362f69804ae18953a0ec11d0c108e8402e1d (diff) | |
| download | catch3-fc32165d48f0a46a60ac02e0e52f8c89adafd8be.tar.gz | |
Started work on splitting out .cpp files from header files
Diffstat (limited to 'include/internal/catch_version.cpp')
| -rw-r--r-- | include/internal/catch_version.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/internal/catch_version.cpp b/include/internal/catch_version.cpp new file mode 100644 index 00000000..d2f234ea --- /dev/null +++ b/include/internal/catch_version.cpp @@ -0,0 +1,44 @@ +/* + * Created by Phil on 14/11/2012. + * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ + +#include "catch_version.h" +#include <ostream> + +namespace Catch { + + Version::Version + ( unsigned int _majorVersion, + unsigned int _minorVersion, + unsigned int _patchNumber, + char const * const _branchName, + unsigned int _buildNumber ) + : majorVersion( _majorVersion ), + minorVersion( _minorVersion ), + patchNumber( _patchNumber ), + branchName( _branchName ), + buildNumber( _buildNumber ) + {} + + std::ostream& operator << ( std::ostream& os, Version const& version ) { + os << version.majorVersion << '.' + << version.minorVersion << '.' + << version.patchNumber; + // branchName is never null -> 0th char is \0 if it is empty + if (version.branchName[0]) { + os << '-' << version.branchName + << '.' << version.buildNumber; + } + return os; + } + + Version libraryVersion() { + static Version version( 2, 0, 0, "develop", 1 ); + return version; + } + +} |