2012-02-25 21:36:22 +01:00
|
|
|
/*
|
|
|
|
* Created by Phil on 25/2/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)
|
|
|
|
*/
|
|
|
|
#ifndef TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
|
|
|
|
#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include "catch_common.h"
|
|
|
|
|
2012-05-15 09:02:36 +02:00
|
|
|
namespace Catch {
|
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
namespace Detail {
|
|
|
|
struct IColourImpl;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Colour {
|
|
|
|
enum Code {
|
|
|
|
None = 0,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
White,
|
|
|
|
Red,
|
|
|
|
Green,
|
|
|
|
Blue,
|
|
|
|
Cyan,
|
|
|
|
Yellow,
|
|
|
|
Grey,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
Bright = 0x10,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
BrightRed = Bright | Red,
|
|
|
|
BrightGreen = Bright | Green,
|
|
|
|
LightGrey = Bright | Grey,
|
|
|
|
BrightWhite = Bright | White,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
// By intention
|
2013-04-05 08:59:28 +02:00
|
|
|
FileName = LightGrey,
|
2013-04-05 08:47:36 +02:00
|
|
|
ResultError = BrightRed,
|
|
|
|
ResultSuccess = BrightGreen,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
Error = BrightRed,
|
|
|
|
Success = Green,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
OriginalExpression = Cyan,
|
|
|
|
ReconstructedExpression = Yellow,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:59:28 +02:00
|
|
|
SecondaryText = LightGrey,
|
2013-04-05 08:47:36 +02:00
|
|
|
Headers = White
|
|
|
|
};
|
|
|
|
|
2013-04-05 08:59:28 +02:00
|
|
|
// Use constructed object for RAII guard
|
2013-04-05 08:47:36 +02:00
|
|
|
Colour( Code _colourCode );
|
|
|
|
~Colour();
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:59:28 +02:00
|
|
|
// Use static method for one-shot changes
|
2013-04-05 08:47:36 +02:00
|
|
|
static void use( Code _colourCode );
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
private:
|
2014-05-19 19:57:14 +02:00
|
|
|
Colour( Colour const& other );
|
2014-04-15 19:44:37 +02:00
|
|
|
static Detail::IColourImpl* impl();
|
2013-04-05 08:47:36 +02:00
|
|
|
};
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2012-02-25 21:36:22 +01:00
|
|
|
} // end namespace Catch
|
|
|
|
|
|
|
|
#endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
|