Text
- More polymorphic formatting.
This commit is contained in:
32
src/text.cpp
32
src/text.cpp
@@ -851,6 +851,22 @@ const std::string format (
|
||||
return output;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string format (
|
||||
const std::string& fmt,
|
||||
int arg1,
|
||||
const std::string& arg2,
|
||||
const std::string& arg3,
|
||||
const std::string& arg4)
|
||||
{
|
||||
std::string output = fmt;
|
||||
replace_positional (output, "{1}", format (arg1));
|
||||
replace_positional (output, "{2}", arg2);
|
||||
replace_positional (output, "{3}", arg3);
|
||||
replace_positional (output, "{4}", arg4);
|
||||
return output;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string format (
|
||||
const std::string& fmt,
|
||||
@@ -919,6 +935,22 @@ const std::string format (
|
||||
return output;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string format (
|
||||
const std::string& fmt,
|
||||
const std::string& arg1,
|
||||
const std::string& arg2,
|
||||
const std::string& arg3,
|
||||
const std::string& arg4)
|
||||
{
|
||||
std::string output = fmt;
|
||||
replace_positional (output, "{1}", arg1);
|
||||
replace_positional (output, "{2}", arg2);
|
||||
replace_positional (output, "{3}", arg3);
|
||||
replace_positional (output, "{4}", arg4);
|
||||
return output;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string leftJustify (const int input, const int width)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user