1 /* 2 * Created by Phil on 14/11/2012. 3 * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. 4 * 5 * Distributed under the Boost Software License, Version 1.0. (See accompanying 6 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 */ 8 #ifndef TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED 9 #define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED 10 11 #include "catch_version.h" 12 13 namespace Catch { 14 Version(unsigned int _majorVersion,unsigned int _minorVersion,unsigned int _patchNumber,char const * const _branchName,unsigned int _buildNumber)15 Version::Version 16 ( unsigned int _majorVersion, 17 unsigned int _minorVersion, 18 unsigned int _patchNumber, 19 char const * const _branchName, 20 unsigned int _buildNumber ) 21 : majorVersion( _majorVersion ), 22 minorVersion( _minorVersion ), 23 patchNumber( _patchNumber ), 24 branchName( _branchName ), 25 buildNumber( _buildNumber ) 26 {} 27 operator <<(std::ostream & os,Version const & version)28 std::ostream& operator << ( std::ostream& os, Version const& version ) { 29 os << version.majorVersion << '.' 30 << version.minorVersion << '.' 31 << version.patchNumber; 32 // branchName is never null -> 0th char is \0 if it is empty 33 if (version.branchName[0]) { 34 os << '-' << version.branchName 35 << '.' << version.buildNumber; 36 } 37 return os; 38 } 39 libraryVersion()40 inline Version libraryVersion() { 41 static Version version( 1, 12, 2, "", 0 ); 42 return version; 43 } 44 45 } 46 47 #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED 48