mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
refactor: remove nocolor:: operations
since color can be on-off at runtime
This commit is contained in:
@@ -57,28 +57,8 @@ inline std::ostream& white (std::ostream& os)
|
|||||||
{if(os.iword(detail::colorize_index()) == 1) {os << "\033[37m";} return os;}
|
{if(os.iword(detail::colorize_index()) == 1) {os << "\033[37m";} return os;}
|
||||||
} // color_ansi
|
} // color_ansi
|
||||||
|
|
||||||
// do nothing.
|
// ANSI escape sequence is the only and default colorization method currently
|
||||||
namespace nocolor
|
|
||||||
{
|
|
||||||
inline std::ostream& colorize (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& nocolorize(std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& reset (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& bold (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& grey (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& red (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& green (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& yellow (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& blue (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& magenta (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& cyan (std::ostream& os) noexcept {return os;}
|
|
||||||
inline std::ostream& white (std::ostream& os) noexcept {return os;}
|
|
||||||
} // nocolor
|
|
||||||
|
|
||||||
#ifdef TOML11_COLORIZE_ERROR_MESSAGE
|
|
||||||
namespace color = color_ansi;
|
namespace color = color_ansi;
|
||||||
#else
|
|
||||||
namespace color = nocolor;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // toml
|
} // toml
|
||||||
#endif// TOML11_COLOR_HPP
|
#endif// TOML11_COLOR_HPP
|
||||||
|
Reference in New Issue
Block a user