Browse Source

Util: Rename formatting danger -> critical

master
Riyyi 2 years ago
parent
commit
e8c4b6eb11
  1. 12
      src/util/format/format.cpp
  2. 28
      src/util/format/format.h

12
src/util/format/format.cpp

@ -60,7 +60,7 @@ void prettyVariadicFormat(Type type, bool bold, std::string_view format, TypeEra
case Type::Warn: case Type::Warn:
stream << "33"; stream << "33";
break; break;
case Type::Danger: case Type::Critital:
stream << "31"; stream << "31";
break; break;
case Type::Success: case Type::Success:
@ -105,7 +105,7 @@ Dbg::Dbg(Type type, bool bold)
case Type::Warn: case Type::Warn:
m_stream << "33"; m_stream << "33";
break; break;
case Type::Danger: case Type::Critical:
m_stream << "31"; m_stream << "31";
break; break;
case Type::Success: case Type::Success:
@ -164,14 +164,14 @@ Dbg warnb()
return Dbg(Type::Warn, true); return Dbg(Type::Warn, true);
} }
Dbg danger() Dbg critical()
{ {
return Dbg(Type::Danger, false); return Dbg(Type::Critical, false);
} }
Dbg dangerb() Dbg criticalb()
{ {
return Dbg(Type::Danger, true); return Dbg(Type::Critical, true);
} }
Dbg success() Dbg success()

28
src/util/format/format.h

@ -65,12 +65,12 @@ void variadicFormat(std::stringstream& stream, std::string_view format, TypeEras
// ----------------------------------------- // -----------------------------------------
enum class Type { enum class Type {
None, // Foreground None, // Foreground
Info, // Blue Info, // Blue
Warn, // Yellow Warn, // Yellow
Danger, // Red Critical, // Red
Success, // Green Success, // Green
Comment, // White Comment, // White
}; };
void prettyVariadicFormat(Type type, bool bold, std::string_view format, TypeErasedParameters& parameters); void prettyVariadicFormat(Type type, bool bold, std::string_view format, TypeErasedParameters& parameters);
@ -89,8 +89,8 @@ FORMAT_FUNCTION(infoln, Info, false);
FORMAT_FUNCTION(infobln, Info, true); FORMAT_FUNCTION(infobln, Info, true);
FORMAT_FUNCTION(warnln, Warn, false); FORMAT_FUNCTION(warnln, Warn, false);
FORMAT_FUNCTION(warnbln, Warn, true); FORMAT_FUNCTION(warnbln, Warn, true);
FORMAT_FUNCTION(dangerln, Danger, false); FORMAT_FUNCTION(criticalln, Critical, false);
FORMAT_FUNCTION(dangerbln, Danger, true); FORMAT_FUNCTION(criticalbln, Critical, true);
FORMAT_FUNCTION(successln, Success, false); FORMAT_FUNCTION(successln, Success, false);
FORMAT_FUNCTION(successbln, Success, true); FORMAT_FUNCTION(successbln, Success, true);
FORMAT_FUNCTION(commentln, Comment, false); FORMAT_FUNCTION(commentln, Comment, false);
@ -126,8 +126,8 @@ Dbg info();
Dbg infob(); Dbg infob();
Dbg warn(); Dbg warn();
Dbg warnb(); Dbg warnb();
Dbg danger(); Dbg critical();
Dbg dangerb(); Dbg criticalb();
Dbg success(); Dbg success();
Dbg successb(); Dbg successb();
Dbg comment(); Dbg comment();
@ -171,8 +171,8 @@ Str str(std::string& fill);
using Util::Format::commentbln; using Util::Format::commentbln;
using Util::Format::commentln; using Util::Format::commentln;
using Util::Format::dangerbln; using Util::Format::criticalbln;
using Util::Format::dangerln; using Util::Format::criticalln;
using Util::Format::dbgbln; using Util::Format::dbgbln;
using Util::Format::dbgln; using Util::Format::dbgln;
using Util::Format::infobln; using Util::Format::infobln;
@ -184,8 +184,8 @@ using Util::Format::warnln;
using Util::Format::comment; using Util::Format::comment;
using Util::Format::commentb; using Util::Format::commentb;
using Util::Format::danger; using Util::Format::critical;
using Util::Format::dangerb; using Util::Format::criticalb;
using Util::Format::dbg; using Util::Format::dbg;
using Util::Format::dbgb; using Util::Format::dbgb;
using Util::Format::info; using Util::Format::info;

Loading…
Cancel
Save