Skip to content

Commit

Permalink
Added support for floating point
Browse files Browse the repository at this point in the history
  • Loading branch information
nohayassin committed Mar 19, 2020
1 parent 282bef6 commit f8fac2c
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions tools/fw-logger/string-formatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ namespace fw_logger

for (size_t i = 0; i < num_of_params; i++)
{
string regular_exp[3];
string replacement[3];
stringstream st_regular_exp[3];
stringstream st_replacement[3];
string regular_exp[4];
string replacement[4];
stringstream st_regular_exp[4];
stringstream st_replacement[4];

st_regular_exp[0] << "\\{\\b(" << i << ")\\}";
regular_exp[0] = st_regular_exp[0].str();
Expand All @@ -52,10 +52,18 @@ namespace fw_logger

exp_replace_map[regular_exp[1]] = replacement[1];

st_regular_exp[2] << "\\{\\b(" << i << "),[a-zA-Z]+\\}";
regular_exp[2] = st_regular_exp[2].str();

st_regular_exp[2] << "\\{\\b(" << i << "):f\\}";
regular_exp[2] = st_regular_exp[2].str();
st_replacement[2] << static_cast<float_t>(params[i]);
replacement[2] = st_replacement[2].str();
exp_replace_map[regular_exp[2]] = replacement[2];


enum_replace_map[regular_exp[2]] = params[i];
st_regular_exp[3] << "\\{\\b(" << i << "),[a-zA-Z]+\\}";
regular_exp[3] = st_regular_exp[3].str();

enum_replace_map[regular_exp[3]] = params[i];
}

return replace_params(source, exp_replace_map, enum_replace_map, dest);
Expand Down

0 comments on commit f8fac2c

Please sign in to comment.