LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
colorize.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace logicalaccess
4{
8namespace Colorize
9{
15namespace detail
16{
17static std::string clear()
18{
19 return "\033[0m";
20}
21
26template <typename T>
27std::string format(const std::string &escape_code, const T &in)
28{
29 std::stringstream ss;
30 ss << "\033[" << escape_code << "m" << in << clear();
31 return ss.str();
32}
33}
34
35template <typename T>
36std::string bold(const T &in)
37{
38 return detail::format("1", in);
39}
40
41template <typename T>
42std::string underline(const T &in)
43{
44 return detail::format("4", in);
45}
46
47template <typename T>
48std::string red(const T &in)
49{
50 return detail::format("31", in);
51}
52
53template <typename T>
54std::string yellow(const T &in)
55{
56 return detail::format("33", in);
57}
58
59template <typename T>
60std::string green(const T &in)
61{
62 return detail::format("32", in);
63}
64}
65}
std::string format(const std::string &escape_code, const T &in)
Definition: colorize.hpp:27
static std::string clear()
Definition: colorize.hpp:17
std::string underline(const T &in)
Definition: colorize.hpp:42
std::string red(const T &in)
Definition: colorize.hpp:48
std::string yellow(const T &in)
Definition: colorize.hpp:54
std::string bold(const T &in)
Definition: colorize.hpp:36
std::string green(const T &in)
Definition: colorize.hpp:60
Definition: asn1.hpp:9