some TODOs solved
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
std::string
|
||||
mini_sprintf_format(bool left_align, bool sign, bool space_on_left, bool padding_by_zero, int width, int precision,
|
||||
int length, char specifier, const MlValue &value) {
|
||||
std::string mini_sprintf_format(bool left_align, bool sign, bool space_on_left, bool padding_by_zero,
|
||||
int width, int precision,
|
||||
int length, char specifier, const MlValue &value) {
|
||||
std::string s;
|
||||
std::ostringstream stream_str; // PERF simpler solution..without string stream
|
||||
std::ostringstream stream_str; // PERF string append should be faster
|
||||
bool is_positive = false;
|
||||
|
||||
if (specifier == 's') {
|
||||
@@ -47,7 +47,7 @@ mini_sprintf_format(bool left_align, bool sign, bool space_on_left, bool padding
|
||||
stream_str << std::setprecision(precision);
|
||||
|
||||
stream_str << dval;
|
||||
s = stream_str.str(); // TODO ??
|
||||
s = stream_str.str();
|
||||
}
|
||||
|
||||
if (width > -1 && s.size() < width) {
|
||||
@@ -172,7 +172,7 @@ std::string mini_sprintf(const std::string &format_str, const std::vector<MlValu
|
||||
// specifier
|
||||
if (si >= format_str.end())
|
||||
return output_str; // invalid end of string
|
||||
if (*si == 'i' || *si == 'd' || *si == 'f' || *si == 's' || *si == 'c') { // TODO more specifiers
|
||||
if (*si == 'i' || *si == 'd' || *si == 'f' || *si == 's' || *si == 'c') { // TODO more specifiers
|
||||
std::string s = mini_sprintf_format(left_align, sign, space_on_left, padding_by_zero, width,
|
||||
precision, length, *si, parameters[arg_position]);
|
||||
arg_position++;
|
||||
|
||||
Reference in New Issue
Block a user