Browse Source

Util: Rename FormatAngleBracket -> FormatOperatorStyle

master
Riyyi 2 years ago
parent
commit
187e082018
  1. 8
      src/util/format/format.cpp
  2. 14
      src/util/format/format.h

8
src/util/format/format.cpp

@ -47,21 +47,21 @@ void variadicFormat(std::stringstream& stream, std::string_view format, TypeEras
// -----------------------------------------
FormatAngleBracket::FormatAngleBracket(std::string& output)
FormatOperatorStyle::FormatOperatorStyle(std::string& output)
: m_output(output)
, m_stream()
, m_builder(m_stream)
{
}
FormatAngleBracket::~FormatAngleBracket()
FormatOperatorStyle::~FormatOperatorStyle()
{
m_output = m_stream.str();
}
FormatAngleBracket formatTo(std::string& output)
FormatOperatorStyle formatTo(std::string& output)
{
return FormatAngleBracket(output);
return FormatOperatorStyle(output);
}
} // namespace Util::Format

14
src/util/format/format.h

@ -84,10 +84,10 @@ void formatTo(std::string& output, std::string_view format, const Parameters&...
// -----------------------------------------
class FormatAngleBracket {
class FormatOperatorStyle {
public:
FormatAngleBracket(std::string& output);
virtual ~FormatAngleBracket();
FormatOperatorStyle(std::string& output);
virtual ~FormatOperatorStyle();
Builder& builder() { return m_builder; }
@ -98,13 +98,13 @@ private:
};
template<typename T>
const FormatAngleBracket& operator<<(const FormatAngleBracket& formatAngleBracket, const T& value)
const FormatOperatorStyle& operator<<(const FormatOperatorStyle& formatOperatorStyle, const T& value)
{
_format(const_cast<FormatAngleBracket&>(formatAngleBracket).builder(), value);
return formatAngleBracket;
_format(const_cast<FormatOperatorStyle&>(formatOperatorStyle).builder(), value);
return formatOperatorStyle;
}
FormatAngleBracket formatTo(std::string& output);
FormatOperatorStyle formatTo(std::string& output);
} // namespace Util::Format

Loading…
Cancel
Save