Text Formatting
- Added another formatter. Time for variadics?
This commit is contained in:
14
src/text.cpp
14
src/text.cpp
@@ -998,6 +998,20 @@ const std::string format (
|
||||
return output;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string format (
|
||||
const std::string& fmt,
|
||||
int arg1,
|
||||
const std::string& arg2,
|
||||
const std::string& arg3)
|
||||
{
|
||||
std::string output = fmt;
|
||||
replace_positional (output, "{1}", format (arg1));
|
||||
replace_positional (output, "{2}", arg2);
|
||||
replace_positional (output, "{3}", arg3);
|
||||
return output;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string format (
|
||||
const std::string& fmt,
|
||||
|
||||
Reference in New Issue
Block a user