Browse Source

Util: Add newlines to long parameter list

master
Riyyi 2 years ago
parent
commit
bd8367db0e
  1. 19
      src/util/format/builder.cpp
  2. 21
      src/util/format/builder.h

19
src/util/format/builder.cpp

@ -62,7 +62,15 @@ static constexpr std::string numberToString(size_t value, uint8_t base, bool upp
return result;
}
void Builder::putU64(size_t value, uint8_t base, bool uppercase, char fill, Align align, Sign sign, bool zeroPadding, size_t width, bool isNegative) const
void Builder::putU64(size_t value,
uint8_t base,
bool uppercase,
char fill,
Align align,
Sign sign,
bool zeroPadding,
size_t width,
bool isNegative) const
{
std::string string = numberToString(value, base, uppercase);
@ -130,7 +138,14 @@ void Builder::putU64(size_t value, uint8_t base, bool uppercase, char fill, Alig
};
}
void Builder::putI64(int64_t value, uint8_t base, bool uppercase, char fill, Align align, Sign sign, bool zeroPadding, size_t width) const
void Builder::putI64(int64_t value,
uint8_t base,
bool uppercase,
char fill,
Align align,
Sign sign,
bool zeroPadding,
size_t width) const
{
bool isNegative = value < 0;
value = isNegative ? -value : value;

21
src/util/format/builder.h

@ -36,8 +36,25 @@ public:
void putLiteral(std::string_view literal);
void putU64(size_t value, uint8_t base = 10, bool uppercase = false, char fill = ' ', Align align = Align::Right, Sign sign = Sign::Negative, bool zeroPadding = false, size_t width = 0, bool isNegative = false) const;
void putI64(int64_t value, uint8_t base = 10, bool uppercase = false, char fill = ' ', Align align = Align::Right, Sign sign = Sign::Negative, bool zeroPadding = false, size_t width = 0) const;
void putU64(size_t value,
uint8_t base = 10,
bool uppercase = false,
char fill = ' ',
Align align = Align::Right,
Sign sign = Sign::Negative,
bool zeroPadding = false,
size_t width = 0,
bool isNegative = false) const;
void putI64(int64_t value,
uint8_t base = 10,
bool uppercase = false,
char fill = ' ',
Align align = Align::Right,
Sign sign = Sign::Negative,
bool zeroPadding = false,
size_t width = 0) const;
void putF64(double number, uint8_t precision = 6) const;
void putCharacter(char character) const { m_builder.write(&character, 1); }
void putString(std::string_view string, char fill = ' ', Align align = Align::Left, size_t width = 0) const;

Loading…
Cancel
Save