1 /* 2 * Created by Phil on 25/2/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_CONSOLE_COLOUR_HPP_INCLUDED 9 #define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED 10 11 #include "catch_common.h" 12 13 namespace Catch { 14 15 struct Colour { 16 enum Code { 17 None = 0, 18 19 White, 20 Red, 21 Green, 22 Blue, 23 Cyan, 24 Yellow, 25 Grey, 26 27 Bright = 0x10, 28 29 BrightRed = Bright | Red, 30 BrightGreen = Bright | Green, 31 LightGrey = Bright | Grey, 32 BrightWhite = Bright | White, 33 34 // By intention 35 FileName = LightGrey, 36 Warning = Yellow, 37 ResultError = BrightRed, 38 ResultSuccess = BrightGreen, 39 ResultExpectedFailure = Warning, 40 41 Error = BrightRed, 42 Success = Green, 43 44 OriginalExpression = Cyan, 45 ReconstructedExpression = Yellow, 46 47 SecondaryText = LightGrey, 48 Headers = White 49 }; 50 51 // Use constructed object for RAII guard 52 Colour( Code _colourCode ); 53 Colour( Colour const& other ); 54 ~Colour(); 55 56 // Use static method for one-shot changes 57 static void use( Code _colourCode ); 58 59 private: 60 bool m_moved; 61 }; 62 operator <<(std::ostream & os,Colour const &)63 inline std::ostream& operator << ( std::ostream& os, Colour const& ) { return os; } 64 65 } // end namespace Catch 66 67 #endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED 68