Files
Catch2/include/internal/catch_console_colour.h
T

70 lines
1.8 KiB
C++
Raw Normal View History

2012-02-25 20:36:22 +00: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 08:02:36 +01:00
namespace Catch {
struct Colour {
enum Code {
None = 0,
2013-07-03 19:14:59 +01:00
White,
Red,
Green,
Blue,
Cyan,
Yellow,
Grey,
2013-07-03 19:14:59 +01:00
Bright = 0x10,
2013-07-03 19:14:59 +01:00
BrightRed = Bright | Red,
BrightGreen = Bright | Green,
LightGrey = Bright | Grey,
BrightWhite = Bright | White,
BrightYellow = Bright | Yellow,
2013-07-03 19:14:59 +01:00
// By intention
2013-04-05 07:59:28 +01:00
FileName = LightGrey,
Warning = BrightYellow,
ResultError = BrightRed,
ResultSuccess = BrightGreen,
ResultExpectedFailure = Warning,
2013-07-03 19:14:59 +01:00
Error = BrightRed,
Success = Green,
2013-07-03 19:14:59 +01:00
OriginalExpression = Cyan,
ReconstructedExpression = BrightYellow,
2013-07-03 19:14:59 +01:00
2013-04-05 07:59:28 +01:00
SecondaryText = LightGrey,
Headers = White
};
2013-04-05 07:59:28 +01:00
// Use constructed object for RAII guard
Colour( Code _colourCode );
2017-07-25 17:16:28 +02:00
Colour( Colour&& other ) noexcept;
Colour& operator=( Colour&& other ) noexcept;
~Colour();
2013-07-03 19:14:59 +01:00
2013-04-05 07:59:28 +01:00
// Use static method for one-shot changes
static void use( Code _colourCode );
2013-07-03 19:14:59 +01:00
private:
bool m_moved = false;
};
2013-07-03 19:14:59 +01:00
2017-07-10 14:25:38 +02:00
std::ostream& operator << ( std::ostream& os, Colour const& );
2012-02-25 20:36:22 +00:00
} // end namespace Catch
#endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED